/* ABSYS Studio — design system « Signal »
   Espace de travail clair et lisible pour des clients professionnels ;
   le marine nuit et l'ambre signalent l'identité et tout ce qui s'écoute
   (rail, cabines d'écoute, forme d'onde).
   Ressources locales (fontes woff2, script app.js) servies en 'self' : CSP inchangée. */

@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("/assets/fonts/schibsted-grotesk-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("/assets/fonts/schibsted-grotesk-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url("/assets/fonts/geist-mono-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url("/assets/fonts/geist-mono-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- tokens */

:root {
    --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    /* Réservée aux valeurs techniques (identifiants, liens copiables) : jamais aux libellés. */
    --mono: "Geist Mono", ui-monospace, "SFMono-Regular", "Consolas", monospace;

    /* Espace de travail : gris bleuté très léger, surfaces blanches, encre marine.
       Chaque jeton de texte tient 4,5:1 sur blanc comme sur le fond. */
    --canvas: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f6f8fb;
    --surface-3: #edf1f6;
    --hairline: #dde3ec;
    --hairline-strong: #cbd3df;

    --ink: #0e1a2b;
    --body: #2b3a52;
    --mute: #4a5870;
    --faint: #5d6b82;

    --accent: #1f5bd8;
    --accent-hover: #1a4fbf;
    --accent-press: #163f99;
    --accent-soft: #e8effc;
    --accent-line: #c9d8f6;
    --on-accent: #ffffff;

    --ok: #17643d;
    --ok-soft: #e3f4ea;
    --ok-line: #bfe3cc;
    --warn: #7a4f00;
    --warn-soft: #fcf1da;
    --warn-line: #f0d9a6;
    --danger: #b3261e;
    --danger-hover: #8f1e18;
    --danger-soft: #fde8e6;
    --danger-line: #f5c4bf;

    /* Rail et cabines d'écoute : marine nuit. */
    --rail: #0e1a2b;
    --rail-2: #16243a;
    --rail-3: #1b2b44;
    --rail-line: #22344f;
    --rail-text: #b4c0d3;
    --rail-text-strong: #ffffff;
    --rail-mute: #8d9bb2;

    --stage: #0e1a2b;
    --stage-2: #13223a;
    --stage-line: #22344f;
    --stage-text: #f4f6f9;
    --stage-mute: #9aa8be;

    /* Ambre : uniquement ce qui s'entend (lecture, forme d'onde). */
    --signal: #f2b544;
    --signal-dim: #6b5a35;
    --on-signal: #1a1206;

    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-pill: 999px;

    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;

    --rail-w: 272px;
    --topbar-h: 60px;
    --control-h: 40px;

    --shadow-1: 0 1px 2px rgba(14, 26, 43, .05);
    --shadow-2:
        0 1px 2px rgba(14, 26, 43, .05),
        0 14px 36px -18px rgba(14, 26, 43, .28);
    --shadow-stage: 0 24px 48px -28px rgba(14, 26, 43, .6);
    --ring: 0 0 0 3px rgba(31, 91, 216, .22);

    --ease: cubic-bezier(.16, .84, .32, 1);

    color-scheme: light;
}

/* ------------------------------------------------------------------ base */

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

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--hairline-strong) transparent;
    scrollbar-width: thin;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -.018em;
    line-height: 1.2;
    text-wrap: balance;
}

h1 { font-size: 28px; letter-spacing: -.026em; line-height: 1.15; }
h2 { font-size: 18px; }
h3 { font-size: 15px; font-weight: 650; }

p { margin: 0; }

a {
    color: var(--accent);
    text-decoration-color: color-mix(in srgb, var(--accent) 32%, transparent);
    text-underline-offset: 3px;
}

a:hover { text-decoration-color: currentColor; }

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

::selection {
    background: var(--accent-line);
    color: var(--ink);
}

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: var(--r-pill);
    background: var(--hairline-strong);
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--mute); background-clip: content-box; }

.skip {
    position: fixed;
    top: 10px;
    left: -9999px;
    z-index: 100;
    padding: 9px 14px;
    border: 1px solid var(--accent);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: var(--shadow-2);
}

.skip:focus { left: 10px; }

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

.mono {
    font-family: var(--mono);
    font-size: .92em;
    letter-spacing: -.01em;
}

.num { font-variant-numeric: tabular-nums; }

.muted { color: var(--mute); }

.lede {
    max-width: 68ch;
    color: var(--mute);
    font-size: 15px;
    line-height: 1.6;
}

/* ------------------------------------------------------------ app shell */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
}

.rail {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 22px 16px 14px;
    background: var(--rail);
    color: var(--rail-text);
}

.rail__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 4px 20px;
    padding: 2px;
    color: var(--rail-text-strong);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.2;
    text-decoration: none;
}

/* Monogramme : quatre barres ambrées, le signal sonore de la marque. */
.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--rail-3);
}

.brand-mark i {
    width: 3px;
    height: 10px;
    border-radius: 2px;
    background: var(--signal);
}

.brand-mark i:nth-child(2) { height: 20px; }
.brand-mark i:nth-child(3) { height: 14px; }
.brand-mark i:nth-child(4) { height: 6px; }

.rail__brand small {
    display: block;
    color: var(--rail-mute);
    font-size: 12.5px;
    font-weight: 400;
    letter-spacing: 0;
}

/* Société pour laquelle on agit et son solde : toujours visibles, en tête du rail. */
.rail__scope {
    display: grid;
    gap: 2px;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid var(--rail-line);
    border-radius: 14px;
    background: var(--rail-2);
}

.rail__scope-label { color: var(--rail-mute); font-size: 12.5px; }

.rail__scope-name {
    overflow: hidden;
    color: var(--rail-text-strong);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail__scope-balance { color: var(--rail-text); font-size: 13px; font-variant-numeric: tabular-nums; }
.rail__scope-balance b { color: var(--rail-text-strong); font-weight: 650; }
.rail__scope .pill { justify-self: start; margin-top: 4px; }

/* « Nouvelle annonce » : le geste principal, mis en avant dans le rail même. */
.nav-item.nav-item--cta {
    margin: 2px 0 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.nav-item.nav-item--cta svg { color: #fff; }
.nav-item.nav-item--cta:hover { background: #3a73eb; color: #fff; }
.nav-item.nav-item--cta:hover svg { color: #fff; }
.nav-item.nav-item--cta:focus-visible { outline-color: #fff; }
.nav-item.nav-item--cta.is-active { background: var(--accent-hover); color: #fff; }
.nav-item.nav-item--cta.is-active svg { color: #fff; }

.rail__nav {
    flex: 1 1 auto;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.nav-group + .nav-group { margin-top: 18px; }

.nav-group__label {
    margin: 0 12px 4px;
    color: var(--rail-mute);
    font-size: 12.5px;
    font-weight: 500;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    color: var(--rail-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .12s var(--ease), color .12s var(--ease);
}

.nav-item + .nav-item { margin-top: 1px; }

.nav-item svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: var(--rail-mute);
    transition: color .12s var(--ease);
}

.nav-item:hover {
    background: var(--rail-2);
    color: var(--rail-text-strong);
}

.nav-item:hover svg { color: var(--rail-text); }

.nav-item.is-active {
    background: var(--rail-3);
    color: var(--rail-text-strong);
    font-weight: 600;
}

.nav-item.is-active svg { color: var(--signal); }

.nav-item--soon {
    color: var(--rail-mute);
    cursor: default;
}

.nav-item--soon svg { color: var(--rail-line); }

.nav-item--soon em {
    margin-left: auto;
    padding: 1px 8px;
    border: 1px solid var(--rail-line);
    border-radius: var(--r-pill);
    color: var(--rail-mute);
    font-size: 11.5px;
    font-style: normal;
    white-space: nowrap;
}

.rail__foot {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--rail-line);
}

.env {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 10px 10px;
    color: var(--rail-mute);
    font-size: 12px;
}

.env::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3ec98a;
    box-shadow: 0 0 0 3px rgba(62, 201, 138, .16);
}

/* user menu — <details> keeps it keyboard-native and script-free */

.user {
    position: relative;
    border-radius: var(--r-md);
}

.user > summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--r-md);
    cursor: pointer;
    list-style: none;
    transition: background .12s var(--ease);
}

.user > summary::-webkit-details-marker { display: none; }
.user > summary:hover,
.user[open] > summary { background: var(--rail-2); }

.avatar {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2a3f60;
    color: var(--rail-text-strong);
    font-size: 12.5px;
    font-weight: 600;
}

.user__id {
    min-width: 0;
    flex: 1 1 auto;
}

.user__name {
    display: block;
    overflow: hidden;
    color: var(--rail-text-strong);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user__org {
    display: block;
    overflow: hidden;
    color: var(--rail-mute);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user > summary > svg {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    color: var(--rail-mute);
}

.user__menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    padding: 4px;
    border: 1px solid var(--rail-line);
    border-radius: var(--r-md);
    background: var(--rail-2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, .28), 0 16px 32px rgba(0, 0, 0, .32);
}

.user__menu a,
.user__menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 9px;
    border: 0;
    border-radius: var(--r-sm);
    background: none;
    color: var(--rail-text);
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.user__menu a:hover,
.user__menu button:hover {
    background: var(--rail-3);
    color: var(--rail-text-strong);
}

.user__menu svg { width: 15px; height: 15px; color: var(--rail-mute); }
.user__menu hr { margin: 4px 0; border: 0; border-top: 1px solid var(--rail-line); }
.user__menu form { margin: 0; }

/* mobile drawer toggle — lives outside the topbar so it can sit above the rail */

.navtoggle { display: none; }

.navtoggle > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    box-shadow: var(--shadow-1);
}

.navtoggle > summary::-webkit-details-marker { display: none; }
.navtoggle > summary svg { width: 18px; height: 18px; }
.navtoggle > summary .icon-close,
.navtoggle[open] > summary .icon-menu { display: none; }
.navtoggle[open] > summary .icon-close { display: block; }

/* -------------------------------------------------------------- topbar */

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--s-4);
    min-height: var(--topbar-h);
    padding: 0 clamp(16px, 3vw, 32px);
    border-bottom: 1px solid var(--hairline);
    background: rgba(244, 246, 249, .94);
    backdrop-filter: blur(8px);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--mute);
    text-decoration: none;
    white-space: nowrap;
}

.breadcrumb a:hover { color: var(--ink); }

.breadcrumb span[aria-current] {
    overflow: hidden;
    color: var(--ink);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb i {
    display: flex;
    flex: 0 0 auto;
    color: var(--faint);
    font-style: normal;
}

.breadcrumb i svg { width: 13px; height: 13px; }

.breadcrumb > span:not([aria-current]) { color: var(--mute); }

.context {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex: 0 1 auto;
    min-width: 0;
    padding: 4px 4px 4px 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.context__label {
    flex: 0 0 auto;
    color: var(--mute);
    white-space: nowrap;
    font-size: 12.5px;
}

/* Sur grand écran, la société et le solde vivent dans le rail ; la barre du haut
   ne les répète que sur mobile, où le rail est replié dans un tiroir. */
@media (min-width: 901px) {
    .topbar .context { display: none; }
}

.context__name {
    flex: 0 1 auto;
    max-width: 28ch;
    min-width: 4ch;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.balance {
    display: flex;
    align-items: baseline;
    flex: 0 0 auto;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    font-size: 12px;
    white-space: nowrap;
}

.balance b {
    font-size: 13px;
    font-weight: 560;
    font-variant-numeric: tabular-nums;
}

.balance span { color: var(--mute); }

/* --------------------------------------------------------------- page */

.page {
    flex: 1 1 auto;
    scroll-margin-top: calc(var(--topbar-h) + 8px);
    width: 100%;
    max-width: 1200px;
    padding: 40px clamp(16px, 4vw, 56px) var(--s-8);
}

.page--wide { max-width: 1400px; }
.page--narrow { max-width: 760px; }

@media (prefers-reduced-motion: no-preference) {
    .page { animation: page-in .28s var(--ease) both; }
    @keyframes page-in {
        from { opacity: .4; transform: translateY(4px); }
        to { opacity: 1; transform: none; }
    }
    @keyframes rise-in {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: none; }
    }
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-5);
    margin-bottom: var(--s-5);
}

.page-head__text { min-width: 0; }
.page-head__text .lede { margin-top: 6px; }

.page-head__actions {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    flex: 0 0 auto;
}

.section { margin-top: 40px; }

.section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-3);
}

.section__head h2 { font-size: 19px; letter-spacing: -.015em; }
.section__head .lede { margin-top: 4px; font-size: 14px; }

.stack { display: grid; gap: var(--s-4); }
.stack--tight { gap: var(--s-2); }
.row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.grow { flex: 1 1 auto; }

/* ------------------------------------------------------------ surfaces */

.card {
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: 18px var(--s-5);
    border-bottom: 1px solid var(--hairline);
}

.card__head h2 { font-size: 16.5px; }
.card__head p { margin-top: 3px; color: var(--mute); font-size: 13.5px; }

.card__body { padding: var(--s-5); }
.card__body--tight { padding: var(--s-4); }

.card__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-2);
    padding: 12px var(--s-5);
    border-top: 1px solid var(--hairline);
    background: var(--surface-2);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.card__foot--split { justify-content: space-between; }

/* metric row — deliberately quiet: no icon tiles, no accent chrome */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.stat {
    padding: 18px var(--s-5) 20px;
    border-right: 1px solid var(--hairline);
}

.stat:last-child { border-right: 0; }

.stat__label {
    color: var(--mute);
    font-size: 13.5px;
}

.stat__value {
    display: block;
    margin-top: 6px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.stat__value.is-empty { color: var(--faint); }

.stat__note {
    display: block;
    margin-top: 6px;
    color: var(--faint);
    font-size: 13px;
}

/* -------------------------------------------------------------- tables */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data th {
    padding: 12px var(--s-5);
    border-bottom: 1px solid var(--hairline);
    background: var(--surface-2);
    color: var(--mute);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}

table.data td {
    padding: 15px var(--s-5);
    border-bottom: 1px solid var(--hairline);
    color: var(--body);
    vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }

table.data td.num,
table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.cell-strong {
    display: block;
    color: var(--ink);
    font-weight: 500;
}

.cell-sub {
    display: block;
    margin-top: 2px;
    color: var(--mute);
    font-size: 13px;
}

.table-link {
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}

.table-link:hover { color: var(--accent); text-decoration: underline; }

.cell-empty {
    padding: var(--s-7) var(--s-5) !important;
    color: var(--mute);
    text-align: center;
}

/* --------------------------------------------------------------- pills */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
}

.pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
.pill--info { background: var(--accent-soft); color: var(--accent); }
.pill--neutral { background: var(--surface-3); color: var(--body); }
.pill--plain::before { display: none; }

/* ------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--control-h);
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: none;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease), box-shadow .12s var(--ease);
}

.btn svg { width: 16px; height: 16px; }

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--shadow-1);
}

.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--primary:active { background: var(--accent-press); border-color: var(--accent-press); }

.btn--quiet {
    border-color: var(--hairline-strong);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-1);
}

.btn--quiet:hover { background: var(--surface-2); }

.btn--ghost { color: var(--body); }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); }

.btn--danger {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.btn--danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn--sm svg { width: 14px; height: 14px; }

.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: .5;
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-group { display: inline-flex; gap: var(--s-2); }

/* --------------------------------------------------------------- forms */

.form { display: grid; gap: var(--s-4); }

.field { display: grid; gap: 6px; }

.field__label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-3);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.field__label span {
    color: var(--faint);
    font-size: 13px;
    font-weight: 400;
}

.field__hint {
    color: var(--mute);
    font-size: 13.5px;
}

.input,
.textarea,
.select {
    width: 100%;
    height: var(--control-h);
    padding: 0 13px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink);
    font-size: 14.5px;
    caret-color: var(--accent);
    transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}

.textarea {
    height: auto;
    min-height: 200px;
    padding: 14px 16px;
    line-height: 1.65;
    resize: vertical;
}

.input::placeholder,
.textarea::placeholder { color: var(--faint); }

.input:hover,
.textarea:hover,
.select:hover { border-color: #aebacb; }

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.input[readonly] {
    background: var(--surface-2);
    color: var(--body);
    font-family: var(--mono);
    font-size: 12.5px;
}

.input[type="file"] {
    padding: 6px 8px;
    height: auto;
    color: var(--body);
    font-size: 13px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14.5px;
}

.check input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px var(--s-4);
    border-bottom: 1px solid var(--hairline);
    cursor: pointer;
}

.choice:last-child { border-bottom: 0; }
.choice:hover { background: var(--surface-2); }

.choice input {
    margin: 2px 0 0;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.choice__text { min-width: 0; }
.choice__text strong { display: block; color: var(--ink); font-weight: 600; }
.choice__text small { display: block; margin-top: 2px; color: var(--mute); font-size: 13.5px; }

.choice:has(input:checked) { background: var(--accent-soft); }
.choice:has(input:checked) .choice__text strong { color: var(--accent); }

/* -------------------------------------------------------------- alerts */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    font-size: 14.5px;
    line-height: 1.5;
}

.alert svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; }
.alert > div { max-width: 74ch; }
.alert strong { font-weight: 700; }
.alert a { color: inherit; }

.alert--error { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.alert--warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.alert--ok { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.alert--info { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

/* --------------------------------------------------------- empty state */

.empty {
    display: grid;
    justify-items: center;
    gap: var(--s-3);
    padding: var(--s-7) var(--s-5);
    text-align: center;
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    background: var(--accent-soft);
    color: var(--accent);
}

.empty__icon svg { width: 18px; height: 18px; }
.empty h3 { font-size: 17px; }
.empty p { max-width: 46ch; color: var(--mute); font-size: 14.5px; }

/* ---------------------------------------------------------------- tabs */

.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: var(--s-5);
    padding-bottom: 0;
    border-bottom: 1px solid var(--hairline);
    overflow-x: auto;
}

.tabs a {
    position: relative;
    flex: 0 0 auto;
    padding: 11px 14px;
    color: var(--mute);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tabs a:hover { color: var(--ink); }

.tabs a.is-active { color: var(--ink); }

.tabs a.is-active::after {
    content: "";
    position: absolute;
    inset: auto 6px -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--accent);
}

/* --------------------------------------------------------- media rows */

.media-list { display: grid; }

.media-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-5);
    padding: 16px var(--s-5);
    border-bottom: 1px solid var(--hairline);
}

.media-row:last-child { border-bottom: 0; }
.media-row:hover { background: var(--surface-2); }

.media-row__copy { min-width: 0; }

.media-row__title {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
}

.media-row__title h3 { font-size: 14.5px; }
.media-row__meta { margin-top: 3px; color: var(--mute); font-size: 13px; }

.player {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 420px);
    margin-top: 12px;
    padding: 3px 3px 3px 11px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    background: var(--surface-2);
}

.player__label {
    flex: 0 0 auto;
    color: var(--mute);
    font-size: 13px;
    font-weight: 500;
}

.media-row audio {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    height: 34px;
    accent-color: var(--accent);
}

.media-row audio::-webkit-media-controls-enclosure,
.media-row audio::-webkit-media-controls-panel {
    border-radius: var(--r-xs);
    background: transparent;
}

.media-row audio::-webkit-media-controls-current-time-display,
.media-row audio::-webkit-media-controls-time-remaining-display {
    font-family: var(--mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.player--empty {
    color: var(--mute);
    font-size: 12.5px;
    padding: 9px 11px;
}

.media-row form { margin: 0; }
.media-row .row-actions { justify-content: flex-end; }
.media-row:target { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent-line); }
.section__head h2 .num { margin-left: 6px; font-size: 14px; font-weight: 500; }
.voice-search { flex-wrap: nowrap; margin: 0 0 var(--s-3); }
.voice-search .input { max-width: 380px; }

/* Fenetre de dialogue : ouverte par le script sur un lien qui, sans lui, mene a
   la page equivalente. Surface detachee, donc ombre detachee et fond assombri. */
.dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-2);
}

.dialog--small { width: min(440px, calc(100vw - 32px)); }
.dialog { overflow-y: auto; }
.clone-samples { display: grid; gap: var(--s-2); }
.design-save .input { width: min(220px, 100%); height: 36px; }

/* Accueil d'une société : un salut, l'annonce à reprendre en premier, puis le départ d'une nouvelle. */
.btn--lg { height: 46px; padding: 0 20px; font-size: 15px; }

.home-hero { margin-bottom: 32px; }

.home-hero__title {
    margin: 0;
    color: var(--ink);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.03em;
}

.home-hero__lede { margin: 8px 0 0; max-width: 64ch; color: var(--mute); font-size: 15.5px; line-height: 1.55; }

.home-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    margin-top: 24px;
}

.home-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 26px 28px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

.home-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; }
.home-card__title { margin: 0; color: var(--ink); font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.018em; overflow-wrap: anywhere; }
.home-card__text { margin: 0; max-width: 58ch; color: var(--mute); font-size: 14.5px; line-height: 1.6; }
.home-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: auto; padding-top: 6px; }
.home-card__note { color: var(--faint); font-size: 13px; }

/* Bandeau sonore : le marine et l'ambre marquent l'univers de l'écoute, sans fausse onde. */
.home-card__signal {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--r-md);
    background: var(--stage);
    color: var(--stage-text);
    font-size: 14px;
}

.home-card__signal .brand-mark { background: var(--stage-2); }

.home-start {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 22px 18px 18px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    background: var(--surface);
}

.home-start h2 { margin: 0 10px 4px; font-size: 16.5px; }
.home-start__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 10px 0; }
.home-start__actions .btn { flex: 1 1 auto; }

.home-steps { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }

.home-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px;
    border-radius: var(--r-md);
}

.home-step__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    background: var(--accent-soft);
    color: var(--accent);
}

.home-step__icon svg { width: 17px; height: 17px; }
.home-step strong { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.home-step p { margin: 1px 0 0; color: var(--mute); font-size: 13px; line-height: 1.45; }

@media (max-width: 900px) {
    .home-hero__grid { grid-template-columns: minmax(0, 1fr); }
    .home-hero__title { font-size: 28px; }
    .home-card { padding: 22px; }
    .home-card__title { font-size: 24px; }
    .home-card__actions .btn { flex: 1 1 auto; }
}

/* Musique : filtres par étiquette (avec script seulement) et actions groupées. */
.tag-filter.folder-bar { display: flex; }
a.chip { background: transparent; text-decoration: none; }
.js .tag-filter.folder-bar a.chip { cursor: pointer; }
.is-tag-hidden { display: none !important; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-3); }
.bulk-bar .select { width: auto; height: 36px; }
.bulk-bar .input { width: min(220px, 100%); height: 36px; }
.dialog::backdrop { background: rgba(14, 26, 43, .5); }
.dialog__inner { display: grid; gap: var(--s-4); padding: var(--s-5); }
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); }
.dialog__head h2 { font-size: 19px; letter-spacing: -.018em; }
.dialog__head .field__hint { margin-top: 4px; }
.dialog__head form { margin: 0; }
.dialog .player { width: 100%; margin-top: 0; }
.dialog audio { display: block; flex: 1 1 auto; width: 100%; height: 38px; accent-color: var(--accent); }
.dialog__text.textarea { min-height: 96px; }
.dialog__or { display: flex; align-items: center; gap: var(--s-3); margin: 0; color: var(--faint); font-size: 13px; }
.dialog__or::before,
.dialog__or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--hairline); }
.dialog__upload { margin: 0; flex-wrap: nowrap; }
.dialog__file { padding-top: 7px; }

@media (max-width: 900px) {
    .dialog__upload { flex-wrap: wrap; }
}

.media-row--action {
    color: inherit;
    text-decoration: none;
}

.media-row--action .media-row__title h3 { color: var(--ink); }
.media-row--action:hover .media-row__title h3 { color: var(--accent); }

.row-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: var(--mute);
}

.row-arrow {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    color: var(--faint);
    transition: color .12s var(--ease), transform .16s var(--ease);
}

.row-arrow svg { width: 16px; height: 16px; }
.media-row--action:hover .row-arrow { color: var(--accent); transform: translateX(2px); }

/* ------------------------------------------------------ editor layout */

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: var(--s-7);
    align-items: start;
}

.steps {
    display: grid;
    gap: 2px;
    position: sticky;
    top: calc(var(--topbar-h) + var(--s-5));
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    color: var(--faint);
    font-size: 13px;
}

.step__dot {
    display: grid;
    place-items: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    background: var(--surface);
    font-size: 11.5px;
    font-weight: 600;
}

.step.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}

.step.is-active .step__dot {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}

.step.is-done { color: var(--body); }
.step.is-done .step__dot { border-color: var(--ok); color: var(--ok); }

.word-count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}

.text-preview {
    padding: var(--s-4) var(--s-5);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    background: var(--surface-2);
    color: var(--body);
    font-size: 15.5px;
    line-height: 1.7;
}

/* key/value list */

.kv {
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
    gap: 10px var(--s-5);
    margin: 0;
    font-size: 14.5px;
}

.kv dt { color: var(--mute); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

.split {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: var(--s-5);
    align-items: start;
}

/* -------------------------------------------------------- auth screens */

.login-shell {
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 100vh;
    padding: var(--s-5);
    background: var(--canvas);
}

.auth {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: var(--s-5);
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: var(--s-6) 0;
}

.auth__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
    text-decoration: none;
}

.auth__card {
    width: 100%;
    padding: var(--s-6);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

.auth__card h1 { font-size: 24px; letter-spacing: -.024em; }
.auth__card .lede { margin-top: 6px; font-size: 15px; }
.auth__card .form { margin-top: var(--s-5); }
.auth__card .alert { margin-top: var(--s-4); }

.auth__foot {
    color: var(--mute);
    font-size: 14px;
    text-align: center;
}

.login-shell > footer {
    padding-top: var(--s-5);
    color: var(--faint);
    font-size: 13px;
    text-align: center;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }

    /* Fallback first: without :has() the rail simply stacks above the content,
       scrollable, so navigation is never lost the way it was before. */
    .rail {
        position: static;
        height: auto;
        padding: 10px 12px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--rail-line);
    }

    .rail__brand { margin: 0 0 12px; }
    .rail__nav { max-height: 46vh; }

    .topbar {
        flex-wrap: wrap;
        gap: var(--s-2);
        padding: 10px clamp(14px, 4vw, 24px);
    }

    @supports selector(:has(*)) {
        .navtoggle {
            display: block;
            position: fixed;
            top: 10px;
            left: 12px;
            z-index: 70;
        }

        /* The summary's own ::after is part of its hit area, so the dimmed
           field closes the drawer on tap without a line of script. */
        .navtoggle[open] > summary::after {
            content: "";
            position: fixed;
            inset: 0 0 0 min(300px, 86vw);
            z-index: -1;
        }

        .rail {
            position: fixed;
            inset: 0 auto 0 0;
            z-index: 60;
            width: min(300px, 86vw);
            height: 100vh;
            padding: 58px 12px 12px;
            border-bottom: 0;
            box-shadow: 0 0 0 1px var(--rail-line), 24px 0 48px rgba(8, 10, 14, .28);
            transform: translateX(-101%);
            transition: transform .22s var(--ease);
        }

        .app-shell:has(.navtoggle[open]) .rail { transform: none; }

        .app-shell::after { content: none; }

        .app-shell:has(.navtoggle[open])::after {
            content: "";
            position: fixed;
            inset: 0;
            z-index: 55;
            background: rgba(8, 10, 14, .48);
        }

        .app-shell:has(.navtoggle[open]) .navtoggle > summary {
            border-color: var(--rail-line);
            background: var(--rail-2);
            color: var(--rail-text-strong);
        }

        .topbar { padding-left: 60px; }
    }

    .tabs a {
        max-width: 58vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .context {
        flex: 1 1 100%;
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        row-gap: 6px;
    }

    .context__name { max-width: none; }

    .page { padding: var(--s-5) clamp(14px, 4vw, 24px) var(--s-7); }

    .page-head { flex-direction: column; align-items: stretch; gap: var(--s-4); }
    .page-head__actions { flex-wrap: wrap; }
    .page-head__actions .btn { flex: 1 1 auto; }

    .stats { grid-template-columns: 1fr; }
    .stat { border-right: 0; border-bottom: 1px solid var(--hairline); }
    .stat:last-child { border-bottom: 0; }

    .editor-layout { grid-template-columns: 1fr; gap: var(--s-5); }

    .steps {
        position: static;
        display: flex;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .step { flex: 0 0 auto; }

    .split { grid-template-columns: 1fr; }

    .media-row { grid-template-columns: 1fr; gap: var(--s-3); }
    .media-row form,
    .media-row .btn { width: 100%; }

    /* the arrow is small enough to stay on the row */
    .media-row--action { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }

    .section__head { flex-direction: column; align-items: stretch; }

    .kv { grid-template-columns: 1fr; gap: 2px var(--s-4); }
    .kv dt { margin-top: 8px; font-size: 12px; }
}

.assistance {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px clamp(16px, 4vw, 56px);
    background: var(--warn-soft);
    color: var(--ink);
    border-bottom: 1px solid var(--warn-line);
    font-size: 14px;
}
.assistance__tag {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--warn);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
}
.assistance__back { margin-left: auto; color: var(--accent); font-weight: 600; }

.btn:active:not([disabled]):not([aria-disabled="true"]) { transform: translateY(1px); }

.media-row.is-playing { background: #fff8e8; box-shadow: inset 0 0 0 1px var(--signal); }
.media-row.is-playing .media-row__title h3 { color: var(--ink); }

/* ------------------------------------------------------------ stepper 3 étapes */

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-5);
    padding: 12px 16px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.stepper ol {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stepper__step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--mute);
    font-size: 13px;
}

.stepper__num {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    font-size: 12.5px;
    font-weight: 600;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}

.stepper__step.is-active { color: var(--ink); font-weight: 500; }
.stepper__step.is-active .stepper__num { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.stepper__step.is-done { color: var(--body); }
.stepper__step.is-done .stepper__num { border-color: var(--ok); color: var(--ok); }
.stepper__step--last .stepper__num { border-color: var(--accent); color: var(--accent); }

.stepper__meta {
    color: var(--faint);
    font-size: 13px;
    white-space: nowrap;
}

.studio-pane { display: grid; gap: var(--s-4); }
.studio-result { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-4) var(--s-5); border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface-2); }
.studio-result form { margin: 0; }
.studio-result .muted { flex: 1 1 240px; }

/* Essais vocaux : compteur, et rallonge quand le prestataire opère l'espace. */
.attempts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-3);
    padding: 12px var(--s-5);
    border-bottom: 1px solid var(--hairline);
    background: var(--surface-2);
}

.attempts .muted { flex: 1 1 200px; font-size: 14px; }
.attempts form { margin: 0; }
.attempts .input { height: 36px; }
.attempts .input#grant-quantity { width: 72px; font-variant-numeric: tabular-nums; }

/* Supervision : le message d'erreur brut doit rester lisible sans deformer la table. */
.supervision__error { max-width: 52ch; color: var(--body); overflow-wrap: anywhere; }
.supervision__error .mono { font-size: 12.5px; color: var(--mute); }

/* ------------------------------------ studio : écrire et choisir la voix */

/* Le formulaire EST la grille : les deux colonnes partent dans le même envoi. */
.compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: var(--s-4);
    margin: 0;
}

.compose__main,
.compose__side { min-width: 0; }

/* La colonne des voix ne doit jamais pousser la page : elle défile seule. */
.compose__side .picker {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 2px;
}

.textarea--tall { min-height: 300px; font-size: 16.5px; line-height: 1.7; }


.rename { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; }
.rename__field { width: min(280px, 100%); height: 38px; }
.rename__label { color: var(--mute); font-size: 14px; }
/* Nom de l'annonce : champ et bouton sur une seule ligne, sauf sur petit écran. */
.page-head__text .rename { margin-top: var(--s-3); flex-wrap: nowrap; }
.page-head__text .rename__label { white-space: nowrap; }
.page-head__text .rename__field { flex: 0 1 360px; width: auto; min-width: 160px; }

@media (max-width: 600px) {
    .page-head__text .rename { flex-wrap: wrap; }
    .page-head__text .rename__field { flex: 1 1 100%; }
}
.rename--block { margin-bottom: var(--s-4); }

/* Etapes du studio : la position reelle dans le parcours, deduite du statut. */
.studio-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.studio-steps__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    border-radius: var(--r-pill);
    color: var(--mute);
    font-size: 14.5px;
}

.studio-steps__num {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid #aebacb;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
}

.studio-steps__item.is-done { color: var(--ok); font-weight: 600; }
.studio-steps__item.is-done .studio-steps__num { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.studio-steps__item.is-current { background: var(--ink); color: #fff; font-weight: 600; }
.studio-steps__item.is-current .studio-steps__num { border-color: #fff; background: #fff; color: var(--ink); }

/* Le champ de recherche sert avec ou sans script : sans lui, l'envoi GET recharge
   l'ecran avec le terme, et le serveur applique le filtre. */
.filter {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-2);
}

.filter .input { flex: 1 1 auto; height: 42px; }
.filter__count { flex: 0 0 auto; color: var(--faint); font-size: 13.5px; }
.pick.is-filtered,
.media-row.is-filtered { display: none; }

@media (max-width: 1024px) {
    .compose { grid-template-columns: minmax(0, 1fr); }
    .compose__side { order: -1; }
    .compose__side .picker { max-height: none; }
    .textarea--tall { min-height: 220px; }
}

/* Suivi : une console de mixage dans l'esprit de l'accueil, puis les étapes
   réelles et les choix de l'annonce sur fond clair. */
.stage {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow-2);
    /* Défilement automatique : l'écran se cale sous la barre du haut, jamais dessous. */
    scroll-margin-top: calc(var(--topbar-h) + var(--s-4));
}

.stage:focus { outline: none; }

.stage__main {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: 292px;
    padding: 40px;
    background: var(--stage);
    color: var(--stage-text);
}

.stage__visual {
    position: absolute;
    z-index: -1;
    inset: 0 0 0 auto;
    width: 64%;
    overflow: hidden;
    pointer-events: none;
}

.stage__photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 72% 35%;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 55%);
    mask-image: linear-gradient(to right, transparent, #000 55%);
}

.stage__body { max-width: 58%; min-width: 0; }

.stage__eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 16px;
    color: var(--rail-text);
    font-size: 14px;
    font-weight: 500;
}

.stage__eyebrow::before { content: ""; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(31, 91, 216, .16); }
.stage--ready .stage__eyebrow::before { background: var(--ok); box-shadow: none; }
.stage__title { max-width: 22ch; margin: 0; color: var(--stage-text); font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; line-height: 1.15; letter-spacing: -.035em; text-wrap: balance; }
.stage__lede { margin: 16px 0 0; max-width: 50ch; color: var(--rail-text); font-size: 15px; line-height: 1.65; }
.stage__work { padding: 28px 40px; }

.stage__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.stage-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-top: var(--s-3);
    border-top: 2px solid var(--hairline-strong);
    color: var(--mute);
}

.stage-step.is-done { border-top-color: var(--ok); color: var(--body); }
.stage-step.is-current { border-top-color: var(--accent); color: var(--ink); }

.stage-step__icon {
    position: relative;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--hairline-strong);
    border-radius: 50%;
}

.stage-step.is-done .stage-step__icon { border-color: var(--ok); background: var(--ok-soft); }

.stage-step.is-done .stage-step__icon::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid var(--ok);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.stage-step.is-current .stage-step__icon { border-color: var(--accent-line); border-top-color: var(--accent); }

.stage-step__text { display: grid; gap: 2px; min-width: 0; }
.stage-step__text strong { font-size: 14.5px; font-weight: 600; }
.stage-step__text small { color: var(--mute); font-size: 13px; }

.stage__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-4);
    margin: var(--s-5) 0 0;
    color: var(--mute);
    font-size: 14px;
}

/* Compteur et mise à jour automatique n'existent qu'avec le script. */
.stage__clock {
    display: none;
    align-items: baseline;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--body);
}

.js .stage__clock { display: inline-flex; }
.stage__clock .num { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.stage__hint--js { display: none; }
.js .stage__hint--js { display: inline; }
.js .stage__hint--nojs { display: none; }

.stage__slow {
    margin: var(--s-3) 0 0;
    padding: 10px 12px;
    border: 1px solid var(--warn-line);
    border-radius: var(--r-md);
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 14px;
}

.stage__slow[hidden] { display: none; }

.stage__recap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px var(--s-5);
    margin: 0;
    padding: 26px 40px 32px;
    border-top: 1px solid var(--hairline);
    background: var(--surface-2);
    color: var(--ink);
    font-size: 15px;
}

.stage__recap dt { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; color: var(--mute); font-size: 13px; }
.stage__recap dt svg { width: 16px; height: 16px; }
.stage__recap dd { margin: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.stage__excerpt { grid-column: 1 / -1; }
.stage__recap .stage__text { max-width: 76ch; color: var(--body); font-size: 16px; font-weight: 400; line-height: 1.65; }
.stage--pending .stage__meta { margin: 0; }

/* Envoi en cours : l'écran provisoire remplace le contenu déjà envoyé. */
[data-studio].is-pending > :not(.stage):not(.studio-steps) { display: none; }

@media (max-width: 900px) {
    .stage__main { min-height: 264px; padding: 32px; }
    .stage__visual { width: 100%; opacity: .2; }
    .stage__body { max-width: 100%; }
    .stage__title { max-width: 26ch; }
    .stage__work, .stage__recap { padding: 24px 32px; }
}

@media (max-width: 600px) {
    .stage__main { min-height: 280px; padding: 28px 22px; }
    .stage__photo { object-position: 78% center; }
    .stage__work, .stage__recap { padding: 22px; }
    .stage__steps { grid-template-columns: minmax(0, 1fr); }
    .stage-step { align-items: center; padding: 0; border-top: 0; }
    .stage-step__icon { flex-basis: 24px; width: 24px; height: 24px; }
    .stage-step.is-done .stage-step__icon::after { left: 7px; top: 4px; }
    .stage__recap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

@media (prefers-reduced-motion: no-preference) {
    .stage { animation: rise-in .32s var(--ease) both; }
    .stage-step.is-current .stage-step__icon { animation: stage-spin .9s linear infinite; }
    [data-studio].is-revealing [data-studio-result] { animation: studio-result-reveal .22s ease-out both; }

    @keyframes studio-result-reveal {
        from { opacity: 0; }
        to { opacity: 1; }
    }

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

.listen-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-4);
}

.listen-row form { margin: 0; }

/* Cabine d'écoute : le seul fond sombre de l'espace de travail. Sans script, le
   lecteur natif reste ; avec script, il est piloté par une commande ambrée et la
   forme d'onde réelle du fichier (voir app.js). */
.listen {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 320px;
    min-width: 0;
    padding: 18px 20px;
    border-radius: var(--r-lg);
    background: var(--stage);
    color: var(--stage-text);
    box-shadow: var(--shadow-stage);
}

.listen .player__label { color: var(--stage-mute); }
.listen audio { flex: 1 1 auto; min-width: 0; width: 100%; height: 40px; color-scheme: dark; accent-color: var(--signal); }
.listen.is-enhanced audio { display: none; }

.booth__play {
    display: grid;
    place-items: center;
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: var(--signal);
    color: var(--on-signal);
    cursor: pointer;
    box-shadow: 0 0 0 7px rgba(242, 181, 68, .14);
    transition: transform .12s var(--ease), box-shadow .2s var(--ease);
}

.booth__play:hover { transform: scale(1.04); }
.booth__play:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.booth__play svg { width: 22px; height: 22px; }
.booth__play .booth__pause { display: none; }
.booth__play.is-playing .booth__start { display: none; }
.booth__play.is-playing .booth__pause { display: block; }

.booth__track { position: relative; flex: 1 1 auto; min-width: 0; height: 64px; }
.booth__wave { display: block; width: 100%; height: 100%; }

/* Curseur natif invisible posé sur l'onde : clavier, lecteur d'écran et clic. */
.booth__seek {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.booth__track:has(.booth__seek:focus-visible) { outline: 2px solid var(--signal); outline-offset: 4px; border-radius: 6px; }

.booth__time { flex: 0 0 auto; min-width: 84px; color: var(--stage-mute); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.booth__time b { color: var(--stage-text); font-weight: 600; }

@media (max-width: 600px) {
    .listen.is-enhanced { flex-direction: row; flex-wrap: wrap; }
    .listen.is-enhanced .booth__track { flex-basis: 100%; order: 3; }
}

/* L'annonce complète précède le catalogue, sur toute la largeur disponible. */
.studio-listening .listen-row { gap: var(--s-3); }
.studio-listening .listen { flex-basis: 100%; }
.studio-listening .listen .player__label { display: none; }
.studio-listening .listen-row .field__hint { flex-basis: 100%; margin: 0; }
.music-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3); min-width: 0; }
.music-preview { min-width: 0; }
.music-preview audio { max-width: 100%; }
.music-preview__toggle { display: none; width: 38px; padding: 0; }
.js .music-preview__toggle { display: inline-flex; }
.js .music-preview audio { display: none; }
.music-preview__toggle .music-preview__pause { display: none; }
.music-preview__toggle.is-playing .music-preview__play { display: none; }
.music-preview__toggle.is-playing .music-preview__pause { display: block; }
.music-preview__error:empty { display: none; }
.music-preview__error { display: block; max-width: 26ch; color: var(--danger); font-size: 13px; }
.studio-edit-actions { display: grid; justify-items: start; gap: var(--s-3); width: 100%; }
.studio-edit-actions > [data-mix-settings] { width: 100%; }
.studio-edit-actions .advanced > summary { padding: 10px 0; justify-content: flex-start; }
.studio-edit-actions .advanced[open] > summary { border-bottom: 0; }

@media (max-width: 600px) {
    .studio-listening .listen { flex-direction: column; align-items: stretch; }
    .studio-listening .listen.is-enhanced { flex-direction: row; }
    .studio-listening .pick--action { grid-template-columns: minmax(0, 1fr); }
    .studio-listening .pick--action > .btn,
    .studio-listening .pick--action > .pill { justify-self: start; }
}

/* Finalisation : le seul geste qui consomme l'Annonce, en clôture du parcours. */
.finalize-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
    padding: 24px 26px 24px 30px;
    border: 2px solid var(--accent);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: 0 16px 36px -22px rgba(31, 91, 216, .45);
}

.finalize-bar__copy { max-width: 62ch; }
.finalize-bar__copy h2 { font-size: 18px; }
.finalize-bar__copy p { margin-top: 4px; color: var(--mute); font-size: 14px; }
.finalize-bar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); flex: 0 0 auto; }
.finalize-bar__actions form { margin: 0; }

@media (max-width: 900px) {
    .finalize-bar { flex-direction: column; align-items: stretch; padding: 20px; }
    .finalize-bar__actions form, .finalize-bar__actions .btn { width: 100%; }
}

.advanced > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: 14px var(--s-5);
    cursor: pointer;
    list-style: none;
}

.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::after { content: "+"; color: var(--mute); font-size: 18px; line-height: 1; }
.advanced[open] > summary { border-bottom: 1px solid var(--hairline); }
.advanced[open] > summary::after { content: "−"; }
.advanced__summary span { display: grid; gap: 2px; }
.advanced__summary small { color: var(--mute); font-size: 13.5px; }
.advanced__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }

.recompose { margin-top: var(--s-2); }

.recompose > summary {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-sm);
    color: var(--body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.recompose > summary::-webkit-details-marker { display: none; }
.recompose > summary:hover { border-color: var(--mute); color: var(--ink); }
.recompose[open] > summary { margin-bottom: var(--s-3); }
.recompose .field__hint { margin: 0 0 var(--s-3); }

/* ------------------------------------------- sélecteur de voix et de musique */

.pane-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
    background: var(--accent-soft);
    color: var(--accent);
}

.pane-icon svg { width: 17px; height: 17px; }

.pane-head__step {
    display: block;
    margin-bottom: 4px;
    color: var(--faint);
    font-size: 13.5px;
    font-weight: 500;
}

.pane-head h2 { font-size: 18px; letter-spacing: -.016em; }

.picker { display: grid; gap: var(--s-2); }
.picker-foot { display: flex; justify-content: flex-end; margin-top: var(--s-4); }

.pick {
    position: relative;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 14px;
    padding: 14px 16px;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    background: var(--surface);
    cursor: pointer;
    transition: background .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.pick:hover { border-color: #aebacb; background: var(--surface); box-shadow: var(--shadow-1); }

.pick input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.pick__index {
    color: var(--faint);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.pick__body { min-width: 0; }
.pick__body strong { display: block; color: var(--ink); font-size: 14.5px; font-weight: 600; }
/* Description complete : le texte se replie sur plusieurs lignes au lieu d'etre tronque. */
.pick__body small {
    display: block;
    margin-top: 2px;
    color: var(--mute);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: normal;
}

/* Choix en cours, en tete de l'etape : l'utilisateur sait ou il en est. */
.pane-current {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: var(--s-3);
    padding: 10px 14px;
    border: 1px solid var(--accent-line);
    border-radius: var(--r-sm);
    background: var(--accent-soft);
    font-size: 14.5px;
}

.pane-current__label { color: var(--accent-press); font-size: 13.5px; }

.pane-current strong { color: var(--ink); font-weight: 600; }

/* Lecteur unique en tete de liste : les lignes n'embarquent plus de lecteur. */
.shared-player {
    margin-bottom: var(--s-3);
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--stage);
    color: var(--stage-text);
}

.shared-player__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.shared-player__title { color: var(--stage-text); font-size: 14px; }
.shared-player .pane-current__label,
.shared-player .player__label { color: var(--stage-mute); }
.shared-player audio { display: block; width: 100%; min-width: 0; height: 38px; color-scheme: dark; accent-color: var(--signal); }

/* Bouton d'ecoute d'une ligne : discret, a cote du nom. */
.pick__listen { justify-self: end; grid-column: 4; }

/* Repli sans script : chaque ligne garde son lecteur, replie dans un details. */
.pick__fallback { grid-column: 1 / -1; }
.pick__fallback > summary {
    color: var(--mute);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
}
.pick__fallback > summary::-webkit-details-marker { display: none; }
.pick__fallback > summary::before { content: "▸ "; color: var(--faint); }
.pick__fallback[open] > summary::before { content: "▾ "; }

/* Sans musique : encadre a part, en tete, jamais noye parmi les pistes. */
.nomusic {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    margin-bottom: var(--s-3);
    padding: 14px 16px;
    border: 1px dashed var(--hairline-strong);
    border-radius: var(--r-md);
    background: var(--surface-2);
}

.nomusic__copy { min-width: 0; flex: 1 1 auto; }
.nomusic__copy strong { display: block; color: var(--ink); font-size: 15.5px; font-weight: 600; }
.nomusic__copy small { display: block; margin-top: 2px; color: var(--mute); font-size: 14px; }

/* Ligne en cours d'ecoute, pilotee par le script sur le fichier reellement lu. */
.pick.is-playing { border-color: var(--signal); background: #fff8e8; box-shadow: inset 0 0 0 1px var(--signal); }

@media (max-width: 640px) {
    .nomusic { flex-direction: column; align-items: stretch; }
    .pick__listen { grid-column: 1 / -1; justify-self: stretch; }
}

.pick__audio {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 3px 3px 11px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    background: var(--surface-2);
}

.pick__audio audio {
    display: block;
    flex: 1 1 auto;
    /* Sans min-width: 0, la largeur intrinseque des controles natifs deborde l'ecran. */
    min-width: 0;
    width: 100%;
    height: 32px;
    accent-color: var(--accent);
}

.pick__audio audio::-webkit-media-controls-enclosure,
.pick__audio audio::-webkit-media-controls-panel {
    border-radius: var(--r-xs);
    background: transparent;
}

.pick__audio audio::-webkit-media-controls-current-time-display,
.pick__audio audio::-webkit-media-controls-time-remaining-display {
    font-family: var(--mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* Forme d'onde : marque de la piste retenue. Le bouton radio reste le repli
   visible partout ou :has() manque — l'etat choisi n'en depend jamais seul. */
.pick__wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 22px;
}

/* Chaque barre porte son amplitude (--amp) : l'animation la module au lieu de
   l'ecraser, donc l'onde garde son relief en bougeant. */
.pick__wave i {
    --amp: .5;
    width: 2px;
    height: 22px;
    border-radius: 1px;
    background: var(--hairline-strong);
    transform: scaleY(var(--amp));
    transition: background .18s var(--ease), transform .18s var(--ease);
}

.pick:hover .pick__wave i { background: var(--mute); }

.pick__wave i:nth-child(1)  { --amp: .22; }
.pick__wave i:nth-child(2)  { --amp: .45; }
.pick__wave i:nth-child(3)  { --amp: .70; }
.pick__wave i:nth-child(4)  { --amp: .38; }
.pick__wave i:nth-child(5)  { --amp: .90; }
.pick__wave i:nth-child(6)  { --amp: .55; }
.pick__wave i:nth-child(7)  { --amp: 1; }
.pick__wave i:nth-child(8)  { --amp: .30; }
.pick__wave i:nth-child(9)  { --amp: .62; }
.pick__wave i:nth-child(10) { --amp: .85; }
.pick__wave i:nth-child(11) { --amp: .35; }
.pick__wave i:nth-child(12) { --amp: .72; }
.pick__wave i:nth-child(13) { --amp: .48; }
.pick__wave i:nth-child(14) { --amp: .95; }
.pick__wave i:nth-child(15) { --amp: .40; }
.pick__wave i:nth-child(16) { --amp: .25; }

.pick:has(input:checked) { border-color: var(--accent); background: #f3f7ff; box-shadow: inset 0 0 0 1px var(--accent); }
.pick:has(input:checked) .pick__body strong { color: var(--ink); }
.pick:has(input:checked) .pick__index { color: var(--accent); }
.pick:has(input:checked) .pick__wave i { background: var(--accent); }
.pick:has(input:checked) .pick__audio { border-color: var(--accent-line); background: transparent; }

/* Variante compacte : colonne etroite des voix, sans rang ni forme d'onde. */
.pick--compact { grid-template-columns: auto minmax(0, 1fr); padding: 10px 12px; }
.pick--compact .pick__audio { padding: 0; border: 0; background: transparent; }
.pick--compact .pick__audio audio { height: 30px; }

/* Variante action : la piste porte son propre envoi, un clic suffit a l'essayer. */
.pick--action {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    margin: 0;
}

.pick--action .pick__audio { grid-column: 1 / -1; }
.pick--action.is-selected { border-color: var(--accent); background: #f3f7ff; box-shadow: inset 0 0 0 1px var(--accent); }
.pick--action.is-selected .pick__body strong { color: var(--ink); }

/* Etroit : la forme d'onde et l'intitule de l'extrait cedent la place au lecteur. */
@media (max-width: 620px) {
    .pick { grid-template-columns: auto auto minmax(0, 1fr); padding: 12px; }
    .pick__wave { display: none; }
    .pick__audio .player__label { display: none; }
    .pick__audio { padding-left: 4px; }
}

/* Fiche finalisée : écoute et fichiers ensemble, gestion secondaire. */
.announcement-listen__body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-6); align-items: center; }
.announcement-listen .listen { flex: none; }
.announcement-sound { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); margin: 0; }
.announcement-sound dt { color: var(--mute); font-size: 13.5px; margin-bottom: 4px; }
.announcement-sound dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.announcement-downloads { padding-left: var(--s-6); border-left: 1px solid var(--hairline); }
.announcement-downloads h3 { margin-bottom: var(--s-3); font-size: 16px; }
.announcement-downloads .row { flex-wrap: wrap; }
.announcement-downloads .field__hint { margin: var(--s-3) 0 0; }
.announcement-detail__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.announcement-transcript { margin: 0; color: var(--body); font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
.announcement-field { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.announcement-field .input, .announcement-field .select { flex: 1 1 180px; min-width: 0; width: 100%; }
.announcement-organize__section { padding: var(--s-5); border-top: 1px solid var(--hairline); }
.announcement-organize__section h2 { font-size: 16px; }
.announcement-organize__section .field__hint { margin: var(--s-3) 0; }
.announcement-organize__section .field__hint:last-child { margin-bottom: 0; }
.announcement-trash { border-top: 1px solid var(--hairline); padding: var(--s-4) var(--s-5); }
.announcement-trash > summary { color: var(--mute); cursor: pointer; font-size: 14px; }
.announcement-trash > div { padding-top: var(--s-4); }
@media (max-width: 1100px) {
    .announcement-listen__body, .announcement-detail__grid { grid-template-columns: minmax(0, 1fr); }
    .announcement-downloads { padding: var(--s-4) 0 0; border-left: 0; border-top: 1px solid var(--hairline); }
}
@media (max-width: 600px) {
    .announcement-sound { grid-template-columns: minmax(0, 1fr); }
    .announcement-downloads .btn { width: 100%; }
}

/* -------------------------------------------------------------- annonces */

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); margin: 0 0 var(--s-4); padding: var(--s-4) var(--s-5); border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); }
.filters .field { flex: 1 1 170px; min-width: 0; margin: 0; }
.filters .field--search { flex: 2 1 240px; }
.filters .btn { flex: none; }
.folder-bar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-2); margin: 0 0 var(--s-4); }
.folder-bar .more[open] { flex-basis: 100%; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
@media (max-width: 900px) {
    .detail-layout { grid-template-columns: minmax(0, 1fr); }
}
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--body); font-size: 14px; font-weight: 500; text-decoration: none; }
.chip:hover { border-color: #8d9bb2; color: var(--ink); }
.chip.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip .num { color: var(--mute); font-variant-numeric: tabular-nums; }
.chip.is-active .num { color: #c6cfdd; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.row-actions form { margin: 0; }
.more > summary { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--body); font-size: 13.5px; font-weight: 600; cursor: pointer; list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover,
.more[open] > summary { border-color: var(--mute); color: var(--ink); }
.more-panel { display: grid; gap: var(--s-3); width: min(360px, 80vw); margin-top: var(--s-2); padding: var(--s-4); border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-2); }
.more-panel form { margin: 0; }
.more-panel .field__hint { margin: 4px 0 0; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; }
.inline-form .input,
.inline-form .select { flex: 1 1 150px; width: auto; min-width: 0; height: 36px; }
/* Gestion des dossiers : nom, « Renommer » et corbeille sur une même ligne. */
.folder-row { display: flex; align-items: center; gap: var(--s-2); }
.folder-row > .inline-form { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
.btn--icon { width: 36px; padding: 0; justify-content: center; flex: 0 0 auto; }

/* -------------------------------------------------------------- crédits */

.credit-form { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin: 0; }
.credit-form .input { width: 88px; height: 36px; font-variant-numeric: tabular-nums; }
.credit-form .input.input--reason { width: 220px; }
.credit-actions { display: grid; gap: var(--s-2); }
.credit-actions .field__hint { margin: 0; }
.credit-form__label { width: 56px; color: var(--mute); font-size: 13.5px; }
.chip--trash { margin-left: auto; }
.credit-more { margin-top: var(--s-2); }
.credit-more > summary { color: var(--mute); font-size: 13.5px; cursor: pointer; list-style: none; }
.credit-more > summary::-webkit-details-marker { display: none; }
.credit-more > summary:hover,
.credit-more[open] > summary { color: var(--ink); }
.credit-more[open] > summary { margin-bottom: var(--s-2); }
.delta-in { color: var(--ok); font-variant-numeric: tabular-nums; }
.delta-out { color: var(--danger); font-variant-numeric: tabular-nums; }
.payer-choice { display: grid; gap: var(--s-2); margin: 0; padding: 0; border: 0; }
.payer-choice legend { margin-bottom: var(--s-2); padding: 0; color: var(--ink); font-size: 14.5px; font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
    .stepper__step.is-active .stepper__num { animation: step-pop .3s var(--ease); }
    @keyframes step-pop {
        from { transform: scale(.6); }
        to { transform: scale(1); }
    }

    /* L'onde n'ondule que sur la ligne retenue : une seule zone animee a l'ecran.
       Le decalage par barre fait courir la vague de gauche a droite. */
    .pick:has(input:checked) .pick__wave i { animation: wave-bar 1.4s var(--ease) infinite alternate; }
    .pick__wave i:nth-child(1)  { animation-delay: 0s; }
    .pick__wave i:nth-child(2)  { animation-delay: .06s; }
    .pick__wave i:nth-child(3)  { animation-delay: .12s; }
    .pick__wave i:nth-child(4)  { animation-delay: .18s; }
    .pick__wave i:nth-child(5)  { animation-delay: .24s; }
    .pick__wave i:nth-child(6)  { animation-delay: .30s; }
    .pick__wave i:nth-child(7)  { animation-delay: .36s; }
    .pick__wave i:nth-child(8)  { animation-delay: .42s; }
    .pick__wave i:nth-child(9)  { animation-delay: .48s; }
    .pick__wave i:nth-child(10) { animation-delay: .54s; }
    .pick__wave i:nth-child(11) { animation-delay: .60s; }
    .pick__wave i:nth-child(12) { animation-delay: .66s; }
    .pick__wave i:nth-child(13) { animation-delay: .72s; }
    .pick__wave i:nth-child(14) { animation-delay: .78s; }
    .pick__wave i:nth-child(15) { animation-delay: .84s; }
    .pick__wave i:nth-child(16) { animation-delay: .90s; }

    @keyframes wave-bar {
        from { transform: scaleY(calc(var(--amp) * .3)); }
        to { transform: scaleY(var(--amp)); }
    }
}

/* ------------------------------------------------------------ paramètres mail */

/* État d'un coup d'œil, avant les onglets : envoi, serveur, expéditeur, file. */
.mail-status {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: var(--s-5);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.mail-status__item { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 16px 20px; border-left: 1px solid var(--hairline); }
.mail-status__item:first-child { border-left: 0; }
.mail-status__item > span { color: var(--mute); font-size: 13px; font-weight: 600; }
.mail-status__item strong { color: var(--ink); font-size: 15.5px; overflow-wrap: anywhere; }
.mail-status__item strong.pill { justify-self: start; font-size: 13.5px; }
.mail-status__item strong.is-empty { color: var(--faint); font-weight: 600; }
.mail-status__item small { color: var(--mute); font-size: 13px; overflow-wrap: anywhere; }
.mail-status__item small.is-alert { color: var(--danger); font-weight: 600; }

.mail-settings { display: grid; gap: var(--s-5); }
.mail-status ~ .alert { margin-bottom: var(--s-5); }
.mail-aside .kv + .field__hint { margin-top: var(--s-3); }
.mail-settings .form, .mail-settings .field { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.mail-settings .input, .mail-settings .textarea { min-width: 0; }

/* Connexion SMTP : formulaire principal et colonne de contrôle. */
.mail-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.mail-aside { display: grid; gap: var(--s-5); }
.mail-aside__link { margin-top: var(--s-3); font-size: 14px; }
.mail-aside__link a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.mail-aside__link svg { width: 15px; height: 15px; }

.mail-form { gap: var(--s-5); }
.mail-fieldset { display: grid; gap: var(--s-4); min-width: 0; margin: 0; padding: var(--s-5) 0 0; border: 0; border-top: 1px solid var(--hairline); }
.mail-fieldset legend { float: left; width: 100%; margin-bottom: 0; padding: 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.mail-fieldset legend + * { clear: both; }

.mail-switch { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; }
.mail-switch:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.mail-switch input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.mail-switch span { display: grid; gap: 2px; }
.mail-switch strong { color: var(--ink); font-size: 15px; }
.mail-switch small { color: var(--mute); font-size: 13.5px; }

.mail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mail-grid--host { grid-template-columns: minmax(0, 1fr) 120px; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Modèles : choix du message, puis éditeur et aperçu côte à côte. */
.mail-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }

.mail-picker__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "icon text" "icon pill";
    align-items: start;
    gap: 8px 12px;
    padding: 16px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--body);
    text-decoration: none;
    box-shadow: var(--shadow-1);
    transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}

.mail-picker__item:hover { border-color: var(--hairline-strong); color: var(--body); }
.mail-picker__item.is-active { border-color: var(--accent); box-shadow: var(--ring); }
.mail-picker__icon { grid-area: icon; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--ink); }
.mail-picker__item.is-active .mail-picker__icon { background: var(--accent-soft); color: var(--accent); }
.mail-picker__icon svg { width: 18px; height: 18px; }
.mail-picker__text { grid-area: text; display: grid; gap: 3px; min-width: 0; }
.mail-picker__text strong { color: var(--ink); font-size: 15px; }
.mail-picker__text small { color: var(--mute); font-size: 13px; line-height: 1.45; }
.mail-picker__item .pill { grid-area: pill; justify-self: start; }

.mail-workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; }

.mail-editor .textarea { min-height: 0; }
.mail-editor__intro { min-height: 170px; }

.mail-vars { display: grid; gap: 8px; padding: 12px 14px; border: 1px dashed var(--hairline-strong); border-radius: var(--r-md); background: var(--surface-2); }
.mail-vars p { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.mail-vars p span { color: var(--mute); font-weight: 400; }
.mail-vars ul { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.mail-vars li { display: inline-flex; align-items: center; gap: 8px; color: var(--mute); font-size: 13.5px; }
.mail-var { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border: 1px solid var(--accent-line); border-radius: var(--r-xs); background: var(--surface); color: var(--accent); cursor: pointer; }
.mail-var code { font-family: var(--mono); font-size: 12.5px; }
.mail-var:hover { background: var(--accent-soft); }
html:not(.js) .mail-var { border-color: var(--hairline); color: var(--ink); cursor: default; pointer-events: none; }

.mail-preview { position: sticky; top: calc(var(--topbar-h) + 16px); overflow: hidden; }
.mail-preview__frame { background: #f4f6f9; }
.mail-preview__frame iframe { display: block; width: 100%; height: 720px; border: 0; }
.mail-preview__test { flex-wrap: wrap; border-radius: 0; }
.mail-preview__test .input { flex: 1 1 200px; width: auto; }
.mail-preview__note { padding: 10px var(--s-5) 14px; background: var(--surface-2); color: var(--mute); font-size: 13px; }

@media (max-width: 1100px) {
    .mail-workbench, .mail-columns { grid-template-columns: minmax(0, 1fr); }
    .mail-preview { position: static; }
    .mail-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mail-status__item:nth-child(3) { border-left: 0; }
    .mail-status__item:nth-child(n + 3) { border-top: 1px solid var(--hairline); }
}

@media (max-width: 760px) {
    .mail-picker { grid-template-columns: minmax(0, 1fr); }
    .mail-picker__text small { display: none; }
}

@media (max-width: 600px) {
    .mail-grid, .mail-grid--host { grid-template-columns: minmax(0, 1fr); }
    .mail-status { grid-template-columns: minmax(0, 1fr); }
    .mail-status__item { border-left: 0; }
    .mail-status__item + .mail-status__item { border-top: 1px solid var(--hairline); }
    .mail-preview__frame iframe { height: 560px; }
}

/* ------------------------------------------------------------ studio : en-tête */

.studio-head { margin-bottom: 4px; }
.studio-head .rename { margin-top: 0; flex-wrap: wrap; gap: 6px 14px; }

/* Le nom de l'annonce est le titre de l'écran, modifiable sur place. */
.rename__title {
    flex: 0 1 760px;
    min-width: 0;
    width: 100%;
    padding: 2px 0;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
    text-overflow: ellipsis;
    transition: border-color .15s var(--ease);
}

.rename__title:hover { border-bottom-color: var(--hairline-strong); }
.rename__title:focus { outline: none; border-bottom-color: var(--accent); }

@media (max-width: 700px) {
    .rename__title { font-size: 24px; }
}

/* --------------------------------------------------- studio : cabine d'écoute */

.booth-stage {
    display: grid;
    gap: 20px;
    padding: 28px 32px 24px;
    border-radius: var(--r-xl);
    background: var(--stage);
    color: var(--stage-text);
    box-shadow: var(--shadow-stage);
    scroll-margin-top: calc(var(--topbar-h) + var(--s-4));
}

.booth-stage:focus { outline: none; }

.booth-stage__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
}

.booth-stage__head h2 { color: var(--stage-text); font-size: 19px; }
.booth-stage__head p { margin-top: 4px; color: var(--stage-mute); font-size: 13.5px; }
.booth-stage__facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.booth-stage__facts dt { color: var(--stage-mute); font-size: 12.5px; }
.booth-stage__facts dd { margin: 2px 0 0; color: var(--stage-text); font-size: 14px; font-weight: 600; }
.booth-stage__wait { margin: 0; padding: 22px; border-radius: var(--r-lg); background: var(--stage-2); color: var(--stage-mute); font-size: 14px; }

.booth-stage .listen { flex: none; background: var(--stage-2); box-shadow: none; padding: 20px 22px; }
.booth-stage .listen.has-marks { padding-bottom: 38px; }

.booth-stage__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding-top: 18px;
    border-top: 1px solid var(--stage-line);
}

.booth-stage__foot > [data-mix-settings] { flex: 1 1 260px; }
.booth-stage .advanced > summary { padding: 6px 0; justify-content: flex-start; gap: 14px; color: var(--stage-text); }
.booth-stage .advanced > summary::after { color: var(--stage-mute); }
.booth-stage .advanced[open] > summary { border-bottom: 0; }
.booth-stage .advanced__summary strong { color: var(--stage-text); font-weight: 600; }
.booth-stage .advanced__summary small { color: var(--stage-mute); }
/* Sans script, les réglages se déplient sur place : ils retrouvent une surface claire. */
.booth-stage [data-mix-content] .form { margin-top: 12px; border-radius: var(--r-md); background: var(--surface); color: var(--ink); }
.booth-stage .pill--ok { background: #17402b; color: #8fe0b5; }

.btn--stage { border-color: var(--stage-line); background: transparent; color: var(--stage-text); }
.btn--stage:hover { border-color: var(--stage-mute); background: var(--stage-2); color: #fff; }
.btn--stage:focus-visible { outline-color: var(--signal); }

/* Repères du mixage posés sur la forme d'onde par le script. */
.booth__marks {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -26px;
    height: 18px;
    opacity: 0;
    transition: opacity .3s var(--ease);
    pointer-events: none;
}

.booth__marks.is-ready { opacity: 1; }

.booth__marks span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    color: var(--stage-mute);
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .booth-stage { padding: 22px 18px 18px; }
    .booth__marks { display: none; }
    .booth-stage .listen.has-marks { padding-bottom: 20px; }
}

/* ------------------------------------------------ studio : lignes de musique */

.pick--action { grid-template-columns: auto minmax(0, 1fr) auto; }
.pick--action .music-actions { justify-content: flex-end; }

.music-preview { display: flex; align-items: center; gap: 8px; }

.js .music-preview__toggle {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: border-color .12s var(--ease), background .12s var(--ease);
}

.js .music-preview__toggle:hover { border-color: var(--accent); color: var(--accent); }
.js .music-preview__toggle svg { width: 16px; height: 16px; }
.js .music-preview__toggle.is-playing { border-color: var(--signal); background: var(--signal); color: var(--on-signal); }
.music-preview audio { max-width: 240px; }

@media (max-width: 600px) {
    .pick--action { grid-template-columns: auto minmax(0, 1fr); }
    .pick--action .music-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ===================================================== page d'accueil publique */

.landing { min-height: 100vh; background: var(--canvas); color: var(--ink); }

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px clamp(16px, 4vw, 48px);
    background: rgba(14, 26, 43, .92);
    backdrop-filter: blur(10px);
    color: var(--stage-text);
}

.landing-nav__brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; font-size: 16px; font-weight: 700; text-decoration: none; }
.landing-nav__links { display: flex; gap: 22px; margin-left: auto; }
.landing-nav__links a { color: var(--stage-mute); font-size: 14px; font-weight: 500; text-decoration: none; }
.landing-nav__links a:hover { color: #fff; }
.landing-nav .btn { margin-left: 4px; }

/* Héros : un micro de studio au centre d'ondes qui le traversent. Le marine et
   l'ambre de l'écoute, en grand. */
.landing-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #0a1422;
    color: var(--stage-text);
}

.landing-hero__photo,
.landing-hero__video {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    max-width: 1600px;
    height: 100%;
    margin-inline: auto;
    object-fit: cover;
    object-position: 72% center;
    -webkit-mask-image: linear-gradient(to right, transparent 45%, #000 65%, #000 94%, transparent), linear-gradient(to bottom, #000 65%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent 45%, #000 65%, #000 94%, transparent), linear-gradient(to bottom, #000 65%, transparent 100%);
    mask-composite: intersect;
    pointer-events: none;
}

.landing-hero__glow {
    position: absolute;
    z-index: -1;
    top: 50%;
    right: 8%;
    width: min(760px, 70vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(242, 181, 68, .1) 0%, rgba(31, 91, 216, .08) 38%, transparent 68%);
    transform: translateY(-50%);
}

.landing-hero__video {
    opacity: 0;
}

.landing-hero__video.is-ready { opacity: 1; }
.landing-hero.has-video .landing-hero__photo { visibility: hidden; }

.landing-hero__motion {
    position: absolute;
    z-index: 2;
    right: 24px;
    bottom: 18px;
}

.landing-hero__motion[hidden],
.landing-hero__motion [hidden] { display: none; }
.landing-hero__motion > span { display: inline-flex; align-items: center; }

.landing-hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: center;
    max-width: 1240px;
    min-height: min(760px, calc(100vh - 66px));
    margin: 0 auto;
    padding: clamp(48px, 7vw, 88px) clamp(16px, 4vw, 48px);
}

.landing-hero__kicker { margin: 0 0 18px; color: var(--signal); font-size: 14px; font-weight: 600; }

.landing-hero h1 {
    max-width: 13ch;
    color: #fff;
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.045em;
}

.landing-hero__lede { max-width: 52ch; margin: 24px 0 0; color: var(--rail-text); font-size: 17.5px; line-height: 1.6; }
.landing-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.landing-hero__points { display: grid; gap: 10px; margin: 32px 0 0; padding: 0; list-style: none; }
.landing-hero__points li { display: flex; align-items: center; gap: 10px; color: var(--stage-text); font-size: 14.5px; }
.landing-hero__points svg { flex: 0 0 18px; width: 18px; height: 18px; color: #8fe0b5; }

/* Les messages flottent à gauche du micro photographié. */
.mic-scene {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 560px;
}

.mic-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 12px 12px;
    border: 1px solid rgba(180, 192, 211, .18);
    border-radius: 16px;
    background: rgba(19, 34, 58, .82);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
    color: var(--stage-text);
    font-size: 13.5px;
}

.mic-card b { display: block; margin-bottom: 6px; font-weight: 600; }
.mic-card__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--signal); color: var(--on-signal); }
.mic-card__icon svg { width: 17px; height: 17px; }
.mic-card__bars { display: flex; align-items: center; gap: 2px; height: 16px; }
.mic-card__bars i { width: 3px; height: 40%; border-radius: 2px; background: var(--signal); }
.mic-card__bars i:nth-child(4n+1) { height: 30%; }
.mic-card__bars i:nth-child(4n+2) { height: 80%; }
.mic-card__bars i:nth-child(4n+3) { height: 100%; }
.mic-card__bars i:nth-child(n+9) { background: var(--signal-dim); }

.mic-card--one { top: 8%; left: -15%; }
.mic-card--two { top: 48%; left: -22%; }
.mic-card--three { bottom: 5%; left: -8%; }

/* Connexion : une section claire et calme juste sous le héros. */
.landing-access {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    gap: clamp(32px, 6vw, 80px);
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 48px) 0;
    scroll-margin-top: 70px;
}

.landing-access__copy h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.landing-access__copy p { margin-top: 12px; max-width: 52ch; color: var(--mute); font-size: 16.5px; line-height: 1.6; }
.landing-access__list { display: grid; gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; }
.landing-access__list li { display: flex; align-items: center; gap: 12px; color: var(--body); font-size: 15px; }
.landing-access__list svg { flex: 0 0 38px; width: 38px; height: 38px; padding: 9px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }

.landing-login {
    display: grid;
    gap: 6px;
    padding: 32px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 30px 70px -36px rgba(14, 26, 43, .45);
}

.landing-login h2 { font-size: 22px; }
.landing-login .lede { font-size: 14px; }
.landing-login .form { margin-top: 16px; }
.landing-login .alert { margin-top: 12px; }
.landing-login .btn--lg { width: 100%; }
.landing-login .auth__foot { margin-top: 10px; text-align: left; }

.landing-section__head { max-width: 760px; margin-bottom: 36px; }
.landing-section__head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.landing-section__head p { margin-top: 12px; color: var(--mute); font-size: 17px; line-height: 1.6; }

.landing-flow,
.landing-uses,
.landing-promise,
.landing-cta { max-width: 1200px; margin: 0 auto; padding: clamp(64px, 9vw, 104px) clamp(16px, 4vw, 48px) 0; }

.landing-flow__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }

.flow-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 24px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

.flow-card__num {
    position: absolute;
    top: 36px;
    left: 36px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.flow-card h3 { margin-top: 10px; font-size: 18px; }
.flow-card p { color: var(--mute); font-size: 14.5px; line-height: 1.6; }

.flow-card__visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 170px;
    padding: 24px;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--stage);
}

.flow-card__visual--text { flex-direction: column; align-items: flex-start; justify-content: center; padding-left: 36px; }
.flow-card__line { display: block; width: 62%; height: 10px; border-radius: 5px; background: #2a3f60; }
.flow-card__line--long { width: 82%; }
.flow-card__line--short { width: 40%; }
.flow-card__caret { display: block; width: 2px; height: 22px; margin-top: -6px; background: var(--signal); }

.flow-card__play { display: grid; place-items: center; flex: 0 0 54px; width: 54px; height: 54px; border-radius: 50%; background: var(--signal); color: var(--on-signal); box-shadow: 0 0 0 7px rgba(242, 181, 68, .14); }
.flow-card__play svg { width: 20px; height: 20px; fill: currentColor; }
.flow-card__bars { display: flex; align-items: center; gap: 3px; flex: 1 1 auto; height: 60px; }
.flow-card__bars i { flex: 1 1 0; height: 40%; border-radius: 2px; background: var(--signal); transform-origin: 50% 50%; }
.flow-card__bars i:nth-child(5n+1) { height: 25%; }
.flow-card__bars i:nth-child(5n+2) { height: 70%; }
.flow-card__bars i:nth-child(5n+3) { height: 100%; }
.flow-card__bars i:nth-child(5n+4) { height: 55%; }
.flow-card__bars i:nth-child(n+15) { background: var(--signal-dim); }

.flow-card__visual--files { flex-wrap: wrap; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-sm); background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; }
.file-chip svg { width: 16px; height: 16px; color: var(--accent); }
.flow-card__phone { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--stage-2); color: var(--signal); }
.flow-card__phone svg { width: 24px; height: 24px; }

.uses-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.use-card {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 22px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
}

.use-card__icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 6px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); }
.use-card__icon svg { width: 20px; height: 20px; }
.use-card h3 { font-size: 16.5px; }
.use-card p { color: var(--mute); font-size: 14px; line-height: 1.55; }

.promise-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    background: var(--hairline);
}

.promise-grid article { display: grid; align-content: start; gap: 8px; padding: 30px; background: var(--surface); }
.promise__icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 6px; border-radius: 50%; background: var(--ink); color: #fff; }
.promise__icon svg { width: 19px; height: 19px; }
.promise-grid h3 { font-size: 17px; }
.promise-grid p { color: var(--mute); font-size: 14.5px; line-height: 1.6; }

.landing-cta { text-align: center; }
.landing-cta h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -.03em; }
.landing-cta p { margin: 12px auto 24px; max-width: 52ch; color: var(--mute); font-size: 16px; }

.landing-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1200px;
    margin: clamp(64px, 9vw, 104px) auto 0;
    padding: 28px clamp(16px, 4vw, 48px) 40px;
    border-top: 1px solid var(--hairline);
    color: var(--faint);
    font-size: 13.5px;
}

.landing-foot .landing-nav__brand { color: var(--ink); }

@media (min-width: 961px) and (max-width: 1200px) {
    .landing-hero__photo, .landing-hero__video { object-position: center; }
    .mic-card--one { top: 4%; left: 0; }
    .mic-card--two { top: auto; bottom: 22%; left: 0; }
    .mic-card--three { bottom: 4%; left: 0; }
}

@media (max-width: 960px) {
    .landing-hero__inner { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .landing-hero__photo,
    .landing-hero__video {
        opacity: .24;
        object-position: 76% center;
        -webkit-mask-image: linear-gradient(to right, transparent, #000 65%), linear-gradient(to bottom, #000 65%, transparent 100%);
        mask-image: linear-gradient(to right, transparent, #000 65%), linear-gradient(to bottom, #000 65%, transparent 100%);
    }
    .landing-hero__video { opacity: 0; }
    .landing-hero__video.is-ready { opacity: .24; }
    .mic-scene { min-height: 300px; }
    .mic-card--one { top: 0; left: 4%; }
    .mic-card--two { top: 38%; left: auto; right: 4%; }
    .mic-card--three { bottom: 0; left: 12%; }
    .landing-hero__glow { right: 50%; top: 72%; transform: translate(50%, -50%); }
    .landing-access { grid-template-columns: minmax(0, 1fr); }
    .landing-flow__steps, .promise-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .landing-nav__links { display: none; }
    .landing-nav .btn { margin-left: auto; }
    .landing-login { padding: 24px; }
    .mic-scene { min-height: 280px; }
    .mic-card { font-size: 12.5px; }
    .mic-card--one { left: 0; }
    .mic-card--two { right: 0; }
}

/* Un seul moment orchestré : l'entrée du héros. L'horizon ambré respire ensuite,
   lentement ; tout s'arrête si le mouvement est réduit. */
@media (prefers-reduced-motion: no-preference) {
    .landing-hero__copy > * { animation: rise-in .6s var(--ease) both; }
    .landing-hero__copy > :nth-child(2) { animation-delay: .08s; }
    .landing-hero__copy > :nth-child(3) { animation-delay: .16s; }
    .landing-hero__copy > :nth-child(4) { animation-delay: .24s; }
    .mic-scene { animation: rise-in .9s var(--ease) .15s both; }
    .mic-card { animation: float 7s ease-in-out infinite alternate; }
    .mic-card--two { animation-delay: -2.3s; }
    .mic-card--three { animation-delay: -4.6s; }
    .flow-card__caret { animation: caret 1.1s steps(1) infinite; }

    @keyframes float {
        from { transform: translateY(-6px); }
        to { transform: translateY(8px); }
    }

    @keyframes caret {
        50% { opacity: 0; }
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-hero__video, .landing-hero__motion { display: none; }
    .landing-hero.has-video .landing-hero__photo { visibility: visible; }
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ------------------------------------------------- à traiter (administration) */

.todo { margin-top: 0; margin-bottom: 32px; }
.todo__list { display: grid; }

.todo__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-4);
    padding: 14px var(--s-5);
    border-bottom: 1px solid var(--hairline);
}

.todo__item:last-child { border-bottom: 0; }

.todo__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
}

.todo__icon svg { width: 18px; height: 18px; }
.todo__icon--danger { background: var(--danger-soft); color: var(--danger); }
.todo__icon--warn { background: var(--warn-soft); color: var(--warn); }
.todo__icon--info { background: var(--accent-soft); color: var(--accent); }
.todo__copy strong { display: block; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.todo__copy small { display: block; margin-top: 2px; color: var(--mute); font-size: 13px; }

.todo__clear {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 16px var(--s-5);
    color: var(--ok);
    font-size: 14px;
    font-weight: 500;
}

.todo__clear svg { width: 18px; height: 18px; flex: 0 0 18px; }

@media (max-width: 700px) {
    .todo__item { grid-template-columns: auto minmax(0, 1fr); }
    .todo__item .btn { grid-column: 1 / -1; justify-self: start; }
}

/* ------------------------------------------------------ demande d'Annonces */

.request-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
    margin-top: 20px;
    padding: 20px 24px;
    border: 1px solid var(--accent-line);
    border-radius: var(--r-lg);
    background: var(--accent-soft);
}

.request-card h2 { font-size: 16.5px; }
.request-card p { margin-top: 4px; max-width: 70ch; color: var(--body); font-size: 14px; }
.request-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); flex: 0 0 auto; }

@media (max-width: 900px) {
    .request-card { flex-direction: column; align-items: stretch; }
}

/* ---------------------------------------------------------- modèles de texte */

.templates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.templates__label { color: var(--faint); font-size: 13px; }
.templates__list { display: flex; flex-wrap: wrap; gap: 6px; }
.templates__notice { margin: 0; }

.templates-admin { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.template-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s-3); }
.template-row { border-bottom: 1px solid var(--hairline); }
.template-row:last-child { border-bottom: 0; }

.template-row > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: 12px 8px;
    cursor: pointer;
    list-style: none;
}

.template-row > summary::-webkit-details-marker { display: none; }
.template-row > summary:hover { background: var(--surface-2); }
.template-row__title strong { display: block; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.template-row__title small { display: block; margin-top: 2px; color: var(--mute); font-size: 13px; }
.template-row__form { padding: 4px 8px 16px; }

@media (max-width: 1000px) {
    .templates-admin, .template-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------- nom de l'annonce enregistré seul */

.rename__status { color: var(--faint); font-size: 13px; }
.rename__status.is-ok { color: var(--ok); }
.rename__status.is-error { color: var(--danger); }
.js .rename[data-autosave] .rename__submit { display: none; }

/* ------------------------------------------- mes annonces : actions d'une ligne */

.row-menu { position: relative; }

.row-menu__toggle {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--body);
    cursor: pointer;
    list-style: none;
    transition: border-color .12s var(--ease), color .12s var(--ease), background .12s var(--ease);
}

.row-menu__toggle::-webkit-details-marker { display: none; }
.row-menu__toggle svg { width: 17px; height: 17px; }
.row-menu__toggle:hover, .row-menu[open] > .row-menu__toggle { border-color: #8d9bb2; color: var(--ink); }
.row-menu__toggle--danger:hover, .row-menu--danger[open] > .row-menu__toggle { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }

.row-menu__panel {
    position: absolute;
    z-index: 25;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    gap: 10px;
    width: min(360px, 86vw);
    padding: 16px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: 0 20px 44px -18px rgba(14, 26, 43, .35);
}

.row-menu__section + .row-menu__section { padding-top: 10px; border-top: 1px solid var(--hairline); }
.row-menu__label { display: block; flex: 0 0 100%; margin-bottom: 2px; color: var(--mute); font-size: 12.5px; font-weight: 500; }
.row-menu__title { margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.row-menu__panel .field__hint { margin: 0; }
.row-menu__panel .form { gap: 10px; }
.row-menu__panel form { margin: 0; }
.row-menu--danger .btn--danger { justify-self: start; }
.row-actions { flex-wrap: nowrap; }

/* Le menu doit pouvoir déborder du tableau sur grand écran. */
@media (min-width: 901px) {
    .table-wrap { overflow: visible; }
}

@media (max-width: 900px) {
    .row-menu__panel { position: fixed; top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; }
}

/* ---------------------------------- studio : écoute à droite, catalogue à gauche */

.studio-listening {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
    gap: 20px;
    align-items: start;
}

.studio-listening__main { grid-column: 1; grid-row: 1; min-width: 0; }

/* La cabine reste sous les yeux pendant qu'on parcourt les musiques. */
.studio-listening__side {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    grid-column: 2;
    grid-row: 1;
    display: grid;
    gap: 16px;
    min-width: 0;
}

.studio-listening__side .booth-stage { gap: 16px; padding: 22px 22px 18px; }
.studio-listening__side .booth-stage__head { flex-direction: column; align-items: stretch; gap: 14px; }
.studio-listening__side .booth-stage__head h2 { font-size: 16.5px; }
.studio-listening__side .booth-stage__facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; }
.studio-listening__side .booth-stage__facts > div:nth-child(3) { grid-column: 1 / -1; }
.studio-listening__side .listen { padding: 16px; gap: 12px; }
.studio-listening__side .booth__play { flex-basis: 52px; width: 52px; height: 52px; }
.studio-listening__side .booth__time { min-width: 0; font-size: 13px; }
.studio-listening__side .finalize-bar { flex-direction: column; align-items: stretch; gap: 14px; padding: 20px; }
.studio-listening__side .finalize-bar__actions,
.studio-listening__side .finalize-bar__actions form,
.studio-listening__side .finalize-bar__actions .btn { width: 100%; }

@media (max-width: 1100px) {
    /* Une colonne : écoute, catalogue, puis finalisation en clôture. */
    .studio-listening { display: flex; flex-direction: column; }
    .studio-listening__side { display: contents; }
    .studio-listening__side .booth-stage { order: 1; }
    .studio-listening__main { order: 2; }
    .studio-listening__side .finalize-bar { order: 3; }
    .studio-listening__side .booth-stage__head { flex-direction: row; align-items: flex-end; }
}

/* ---------------------------------------------------- studio : catalogue musical */

.music-toolbar { display: grid; gap: 12px; margin-bottom: 14px; }
.music-toolbar .tag-filter.folder-bar { margin: 0; }
.music-toolbar .filter { margin: 0; }

.pick__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.pick__tag { padding: 1px 9px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--body); font-size: 12.5px; font-weight: 500; }
.pick__duration { color: var(--faint); font-size: 12.5px; }

.pick__current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ok);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
}

.pick__current svg { width: 17px; height: 17px; }
.picker__empty { margin: 8px 0 0; padding: 18px; border-radius: var(--r-md); background: var(--surface-2); color: var(--mute); font-size: 14px; text-align: center; }
.music-pane .nomusic { margin: 14px 0 0; }
.music-pane .pane-head h2 { font-size: 18px; }

/* ---------------------------------------------- mes annonces : lignes allégées */

table.data .col-check { width: 44px; padding-right: 0; }
.col-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.cell-date { white-space: nowrap; }
.cell-date .cell-strong { font-weight: 500; }

/* Nom : lien vers le studio, crayon pour renommer sur place. */
.name-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.name-cell__link { min-width: 0; overflow-wrap: anywhere; }
.name-cell__form { flex: 1 1 auto; margin: 0; }
.name-cell__input { height: 36px; font-weight: 600; }

.name-cell__edit {
    display: none;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: var(--r-xs);
    background: transparent;
    color: var(--faint);
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s var(--ease), background .12s var(--ease), color .12s var(--ease);
}

.js .name-cell__edit { display: inline-grid; }
.name-cell__edit svg { width: 16px; height: 16px; }
tr:hover .name-cell__edit, .name-cell__edit:focus-visible { opacity: 1; }
.name-cell__edit:hover { background: var(--surface-3); color: var(--ink); }
.name-cell__edit[hidden] { display: none; }
.name-cell__status { color: var(--ok); font-size: 12.5px; white-space: nowrap; }
.name-cell__status:empty { display: none; }

/* Dossier : un bouton qui dit où est rangée l'annonce, un clic pour la déplacer. */
.folder-pick__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 200px;
    min-height: 34px;
    padding: 0 10px 0 12px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--body);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.folder-pick__toggle::-webkit-details-marker { display: none; }
.folder-pick__toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-pick__toggle svg { flex: 0 0 14px; width: 14px; height: 14px; color: var(--faint); }
.folder-pick__toggle:hover, .folder-pick[open] > .folder-pick__toggle { border-color: #8d9bb2; color: var(--ink); }
.folder-pick .folder-pick__panel { right: auto; left: 0; width: min(280px, 86vw); padding: 8px; gap: 8px; }
.folder-pick__list { display: grid; gap: 2px; margin: 0; }

.folder-pick__option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-xs);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.folder-pick__option:hover { background: var(--surface-3); }
.folder-pick__option.is-current { color: var(--accent-press); font-weight: 600; }
.folder-pick__option svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--accent); }
.folder-pick__spacer { flex: 0 0 16px; }
.folder-pick__new { display: flex; gap: 6px; margin: 0; padding: 8px 2px 2px; border-top: 1px solid var(--hairline); }
.folder-pick__new .input { flex: 1 1 auto; min-width: 0; height: 36px; }

/* Menu « ⋯ » : une liste d'actions simples. */
.row-menu__panel--list { width: min(300px, 86vw); padding: 6px; gap: 2px; }
.row-menu__panel--list form { margin: 0; }

.row-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-xs);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.row-menu__item:hover { background: var(--surface-3); color: var(--ink); }
.row-menu__item svg { flex: 0 0 17px; width: 17px; height: 17px; color: var(--mute); }
.row-menu__hint { margin: 0 10px 6px 37px; color: var(--faint); font-size: 12.5px; line-height: 1.45; }

/* Sélection multiple : la barre n'apparaît, avec le script, qu'une fois une annonce cochée. */
.bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px 12px 10px 16px;
    border: 1px solid var(--accent-line);
    border-radius: var(--r-md);
    background: var(--accent-soft);
}

.bulk-actions__count { flex: 1 1 auto; color: var(--ink); font-size: 14px; font-weight: 600; }
.bulk-actions .select { width: auto; min-width: 180px; height: 36px; }
.bulk-actions.is-enhanced:not(.is-active) { display: none; }

@media (prefers-reduced-motion: no-preference) {
    .bulk-actions.is-active { animation: rise-in .2s var(--ease) both; }
}

/* ======================================== mes annonces : dossiers en colonne */

.js .nojs-only { display: none; }
.js-only { display: none; }
.js .js-only { display: flex; }

.library { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.library__main { min-width: 0; }

.folders {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    display: grid;
    gap: 6px;
    padding: 16px 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
}

.folders__title { margin: 0 8px 4px; color: var(--faint); font-size: 13px; font-weight: 600; }
.folders__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.folders__item { position: relative; border-radius: var(--r-sm); transition: background .15s var(--ease), box-shadow .15s var(--ease); }
.folders__entry { display: flex; align-items: center; gap: 2px; }
.folders__entry .name-cell__form { flex: 1 1 auto; padding: 2px; }
.folders__entry .name-cell__input { height: 34px; font-weight: 500; }

.folders__link {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--r-sm);
    color: var(--body);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s var(--ease), color .15s var(--ease);
}

.folders__link:hover { background: var(--surface-3); color: var(--ink); }
.folders__link.is-active { background: var(--accent-soft); color: var(--accent-press); font-weight: 600; }
.folders__label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folders__count { flex: 0 0 auto; color: var(--faint); font-size: 12.5px; }
.folders__link.is-active .folders__count { color: var(--accent-press); }
.folders__link--trash { margin-top: 4px; border-top: 1px solid var(--hairline); border-radius: 0 0 var(--r-sm) var(--r-sm); }

.folders__menu { flex: 0 0 auto; }

.folders__menu-toggle {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: var(--r-xs);
    color: var(--faint);
    cursor: pointer;
    list-style: none;
    opacity: 0;
    transition: opacity .12s var(--ease), background .12s var(--ease);
}

.folders__menu-toggle::-webkit-details-marker { display: none; }
.folders__menu-toggle svg { width: 16px; height: 16px; }
.folders__item:hover .folders__menu-toggle,
.folders__menu-toggle:focus-visible,
.folders__menu[open] > .folders__menu-toggle { opacity: 1; }
.folders__menu-toggle:hover { background: var(--surface-3); color: var(--ink); }
.folders__menu .row-menu__panel { right: auto; left: 0; }
.folders .name-cell__status { padding: 0 10px; }

.folders__create > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--r-sm);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.folders__create > summary::-webkit-details-marker { display: none; }
.folders__create > summary:hover { background: var(--accent-soft); }
.folders__create > summary svg { width: 16px; height: 16px; }
.folders__create-form { display: flex; gap: 6px; padding: 4px 2px 6px; }
.folders__create-form .input { flex: 1 1 auto; min-width: 0; height: 36px; }

.row-menu__item--danger { color: var(--danger); }
.row-menu__item--danger svg { color: var(--danger); }
.row-menu__item--danger:hover { background: var(--danger-soft); color: var(--danger); }
.row-menu__heading { margin: 6px 10px 2px; color: var(--faint); font-size: 12px; font-weight: 600; }

/* Glisser-déposer : la ligne se soulève, le dossier survolé s'allume. */
.is-dragging-announcement .folders__item[data-folder-drop] { box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.folders__item.is-drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
[data-announcement-row].is-dragging { opacity: .55; }

@media (max-width: 960px) {
    .library { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .folders { position: static; grid-template-columns: minmax(0, 1fr); padding: 10px; }
    .folders__title { display: none; }
    .folders__list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
    .folders__item { flex: 0 0 auto; }
    .folders__link { border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); white-space: nowrap; }
    .folders__link--trash { margin: 0; justify-self: start; border-radius: var(--r-pill); }
}

/* ------------------------------------------------- barre de filtres en une ligne */

.list-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 14px; }
.list-filters__search { position: relative; flex: 1 1 260px; min-width: 0; }
.list-filters__search svg { position: absolute; top: 50%; left: 13px; width: 17px; height: 17px; color: var(--faint); transform: translateY(-50%); pointer-events: none; }
.list-filters__search .input { padding-left: 40px; }
.js .list-filters__submit { display: none; }
.list-filters__more { position: relative; }

.list-filters__more > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.list-filters__more > summary::-webkit-details-marker { display: none; }
.list-filters__more > summary .num { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; }
.list-filters__panel { position: absolute; z-index: 25; top: calc(100% + 8px); right: 0; display: grid; gap: 12px; width: min(300px, 86vw); padding: 16px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: 0 20px 44px -18px rgba(14, 26, 43, .35); }

/* Sélecteur à trois positions : la pastille glisse sous l'option choisie. */
.segmented {
    position: relative;
    display: inline-flex;
    margin: 0;
    padding: 4px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-pill);
    background: var(--surface-2);
}

.segmented__option { position: relative; z-index: 1; cursor: pointer; }
.segmented__option input { position: absolute; opacity: 0; pointer-events: none; }

.segmented__option span {
    display: block;
    padding: 7px 16px;
    border-radius: var(--r-pill);
    color: var(--mute);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: color .2s var(--ease);
}

.segmented__option input:checked + span { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-1); }
.segmented__option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented__thumb { display: none; }
.segmented.is-ready .segmented__option input:checked + span { background: transparent; box-shadow: none; }

.segmented.is-ready .segmented__thumb {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    display: block;
    border-radius: var(--r-pill);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(14, 26, 43, .14);
    transition: transform .22s cubic-bezier(.2, .9, .3, 1.1), width .22s var(--ease);
}

/* ------------------------------------------------------- lignes et animations */

.announcements-table tbody tr { transition: background .15s var(--ease), opacity .24s var(--ease), transform .24s var(--ease); }
.announcements-table tbody tr.is-selected td { background: #f3f7ff; }
.announcements-table tbody tr.is-leaving { opacity: 0; transform: translateX(-16px); }
.cell-sub__folder:not(:empty)::before { content: "\00B7"; margin: 0 6px; color: var(--hairline-strong); }
.cell-sub__folder { display: inline-block; color: var(--accent-press); font-weight: 500; }
.row-actions form { margin: 0; }
.row-actions__duplicate { color: var(--body); }
.row-actions__duplicate svg { width: 15px; height: 15px; }
.row-actions .row-menu__toggle { opacity: .75; transition: opacity .15s var(--ease), border-color .12s var(--ease), color .12s var(--ease), background .12s var(--ease); }
tr:hover .row-actions .row-menu__toggle, .row-actions .row-menu__toggle:focus-visible, .row-actions .row-menu[open] .row-menu__toggle { opacity: 1; }

[data-list-region].is-loading { opacity: .5; transition: opacity .15s var(--ease); pointer-events: none; }

/* Barre de sélection : collée au bas de l'écran pendant qu'on coche. */
.bulk-actions.is-enhanced.is-active {
    position: sticky;
    bottom: 16px;
    z-index: 15;
    margin-top: 14px;
    box-shadow: 0 18px 40px -16px rgba(14, 26, 43, .4);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: min(560px, calc(100vw - 32px));
    padding: 12px 14px 12px 18px;
    border-radius: var(--r-md);
    background: var(--stage);
    color: var(--stage-text);
    font-size: 14px;
    box-shadow: 0 18px 40px -14px rgba(14, 26, 43, .55);
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast__undo { padding: 6px 12px; border: 1px solid var(--stage-line); border-radius: var(--r-sm); background: transparent; color: var(--signal); font: inherit; font-weight: 600; cursor: pointer; }
.toast__undo:hover { background: var(--stage-2); }

@media (prefers-reduced-motion: no-preference) {
    .is-bumped { animation: bump .32s cubic-bezier(.2, .9, .3, 1.4); }
    [data-list-region].is-entering { animation: list-in .18s var(--ease) both; }
    .row-menu[open] > .row-menu__panel { animation: menu-in .15s var(--ease) both; transform-origin: top right; }
    .folders__menu[open] > .row-menu__panel { transform-origin: top left; }
    .list-filters__more[open] > .list-filters__panel { animation: menu-in .15s var(--ease) both; transform-origin: top right; }
    .bulk-actions.is-enhanced.is-active { animation: bar-up .22s var(--ease) both; }
    .folders__create[open] .folders__create-form { animation: rise-in .18s var(--ease) both; }

    @keyframes list-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
    @keyframes menu-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
    @keyframes bar-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
    @keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
}

/* ============================ mes annonces : liste à deux lignes (remplace le tableau) */

.announcement-list {
    overflow: visible;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.announcement-list__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
    padding: 0 20px;
    border-bottom: 1px solid var(--hairline);
    color: var(--mute);
    font-size: 13.5px;
}

.announcement-list__all { display: inline-flex; align-items: center; gap: 12px; color: var(--body); font-weight: 500; cursor: pointer; }
.announcement-list__all input,
.announcement-item__check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.announcement-list__total { margin-left: auto; color: var(--faint); }
.announcement-list__items { margin: 0; padding: 0; list-style: none; }

.announcement-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hairline);
    transition: background .15s var(--ease), opacity .24s var(--ease), transform .24s var(--ease);
}

.announcement-item:last-child { border-bottom: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.announcement-item:hover { background: var(--surface-2); }
.announcement-item.is-selected { background: #f3f7ff; }
.announcement-item.is-leaving { opacity: 0; transform: translateX(-16px); }
.announcement-item.is-dragging { opacity: .5; }
.announcement-item[hidden] { display: none; }

.announcement-item__main { display: grid; gap: 5px; min-width: 0; }
.announcement-item__title { color: var(--ink); font-size: 15px; font-weight: 600; }

.announcement-item .name-cell { gap: 4px; }
.announcement-item .name-cell__link {
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
}

.announcement-item .name-cell__link:hover { color: var(--accent); }
.announcement-item .name-cell__input { height: 34px; font-size: 15px; }

.announcement-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 0;
    color: var(--faint);
    font-size: 13px;
}

.announcement-item__meta > * + *::before { content: "\00B7"; margin: 0 8px; color: var(--hairline-strong); }
.announcement-item__meta .pill { margin-right: 4px; font-size: 12px; padding: 2px 9px; }
.announcement-item__meta .pill + *::before { content: none; }
.announcement-item__meta .pill + * { margin-left: 4px; }
.announcement-item__folder { color: var(--accent-press); font-weight: 500; }
.announcement-item__folder:empty { display: none; }
.announcement-item__purge { color: var(--faint); font-size: 13px; }

.announcement-item .row-actions { flex-wrap: nowrap; gap: 6px; }
.announcement-item .row-actions .btn--sm { height: 34px; }
.announcement-item .row-actions .row-menu__toggle { width: 34px; height: 34px; }

@media (max-width: 1100px) {
    .announcement-item__date { display: none; }
    .announcement-item { grid-template-columns: 18px minmax(0, 1fr) auto; }
}

@media (max-width: 760px) {
    .announcement-item { grid-template-columns: 18px minmax(0, 1fr); padding: 14px 16px; }
    .announcement-item .row-actions { grid-column: 2; flex-wrap: wrap; }
    .announcement-item .name-cell__link { white-space: normal; }
}

.announcement-item__meta { flex-wrap: nowrap; min-width: 0; }
.announcement-item__meta > span:not(.pill) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announcement-item__date { display: grid; justify-items: end; gap: 2px; color: var(--faint); font-size: 13px; white-space: nowrap; }
.announcement-item__date span:first-child { color: var(--body); font-weight: 500; }

/* Dossiers : le compteur cède sa place au menu au survol, les chiffres restent alignés. */
.folders__entry { position: relative; }
.folders__entry .folders__link { padding-right: 10px; }
.folders__menu { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); }
.folders__item:hover .folders__entry .folders__count,
.folders__entry:focus-within .folders__count { opacity: 0; }
.folders__entry.is-editing .folders__menu { display: none; }

/* Le dossier reste lisible, c'est l'auteur qui cède ; dates et actions alignées d'une ligne à l'autre. */
.announcement-item__folder { flex: 0 0 auto; }
.announcement-item__meta > span:not(.pill):not(.announcement-item__folder) { flex: 0 1 auto; min-width: 0; }
.announcement-item__date { width: 96px; }
.announcement-item .row-actions > .btn:first-child { min-width: 104px; justify-content: center; }

.library > *, .folders, .folders__list { min-width: 0; }

@media (max-width: 1100px) {
    .announcement-item .announcement-item__date { display: none; }
}

@media (max-width: 760px) {
    .list-filters__search { flex-basis: 100%; }
    .announcement-item .row-actions > .btn:first-child { min-width: 0; }
    .announcement-list__head { padding: 0 16px; }
}

/* Menu d'un dossier : au-dessus de la liste, ouvert vers la gauche, compteur masqué. */
.folders { z-index: 20; }
.folders .folders__menu .row-menu__panel { right: 0; left: auto; width: 210px; transform-origin: top right; }
.folders__entry:has(.folders__menu[open]) .folders__count { opacity: 0; }

/* Le menu ouvert passe au-dessus des dossiers suivants. */
.folders__menu[open] { z-index: 30; }

/* La liste s'adapte à sa propre largeur : la date, puis le libellé « Dupliquer » cèdent
   la place au nom avant que celui-ci ne soit tronqué. */
.announcement-list { container: annonces / inline-size; }
.list-filters__search { flex: 1 1 200px; }

@container annonces (max-width: 860px) {
    .announcement-item .announcement-item__date { display: none; }
    .announcement-item { grid-template-columns: 18px minmax(0, 1fr) auto; }
}

@container annonces (max-width: 600px) {
    .row-actions__duplicate { width: 34px; padding: 0; }
    .row-actions__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .announcement-item .row-actions > .btn:first-child { min-width: 0; }
}

/* Un nom long passe sur deux lignes plutôt que d'être tronqué. */
.announcement-item .name-cell__link { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; overflow-wrap: break-word; }

/* =====================================================================
   Refonte du parcours — 3 octobre 2026
   Studio en trois temps (écrire, habiller et écouter, récupérer), mode
   expert avec table de montage, bibliothèque à deux états, accueil
   « cabine d'entrée » et fiche d'annonce terminée. Mêmes jetons Signal :
   marine pour ce qui s'écoute, ambre pour le son, bleu pour l'action.
   ===================================================================== */

:root {
    /* Blocs du montage : trois teintes distinctes, lisibles sur le marine comme sur le clair. */
    --block-1: #5b8def;
    --block-1-soft: #e8effc;
    --block-1-ink: #1a4fbf;
    --block-2: #2fb59a;
    --block-2-soft: #dcf4ee;
    --block-2-ink: #0b6652;
    --block-3: #a98bf0;
    --block-3-soft: #eee8fc;
    --block-3-ink: #5a3fb8;
    --lane: #0b1524;
}

.btn--soft { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-press); }
.btn--soft:hover { border-color: var(--accent); background: #dce7fb; color: var(--accent-press); }
.btn--lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn--lg svg { width: 18px; height: 18px; }

/* ------------------------------------------------------- en-tête du studio */

.studio-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.studio-head .page-head__text { flex: 1 1 420px; min-width: 0; }
.studio-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
}
.mode-chip svg { width: 14px; height: 14px; }
.mode-chip--simple { background: var(--surface-3); color: var(--body); }
.studio-head .attempts { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; }
.studio-head .attempts .pill { height: 28px; font-size: 12.5px; }
.attempts__warn { color: var(--warn); font-size: 13px; font-weight: 600; }
.attempts__grant { position: relative; }
.attempts__grant > summary { list-style: none; }
.attempts__grant > summary::-webkit-details-marker { display: none; }
.attempts__grant .row-menu__panel { right: 0; left: auto; width: 280px; padding: 14px; }

/* ------------------------------------------------- étapes : trois temps */

.studio .studio-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 6px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.studio .studio-steps__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background: none;
    color: var(--mute);
    font-size: 14px;
    font-weight: 400;
}

.studio .studio-steps__item + .studio-steps__item::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    width: 16px;
    height: 2px;
    background: var(--hairline-strong);
}

.studio .studio-steps__item.is-done + .studio-steps__item::before { background: var(--ok); }
.studio .studio-steps__link { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.studio .studio-steps__link:hover strong { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.studio .studio-steps__text { display: grid; gap: 1px; min-width: 0; }
.studio .studio-steps__text strong { overflow: hidden; color: inherit; font-size: 14.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.studio .studio-steps__text small { overflow: hidden; color: var(--faint); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.studio .studio-steps__num { flex: 0 0 30px; width: 30px; height: 30px; border-color: var(--hairline-strong); background: var(--surface); color: var(--mute); }
.studio .studio-steps__num svg { width: 15px; height: 15px; stroke-width: 2.4; }
.studio .studio-steps__item.is-done { color: var(--ink); font-weight: 400; }
.studio .studio-steps__item.is-done .studio-steps__num { border-color: var(--ok); background: var(--ok); color: #fff; }
.studio .studio-steps__item.is-current { background: var(--ink); color: #fff; }
.studio .studio-steps__item.is-current small { color: #b4c0d3; }
.studio .studio-steps__item.is-current .studio-steps__num { border-color: var(--signal); background: var(--signal); color: var(--on-signal); }

@media (max-width: 760px) {
    .studio .studio-steps { grid-template-columns: auto auto auto; justify-content: start; gap: 4px; }
    .studio .studio-steps__text small { display: none; }
    .studio .studio-steps__item { gap: 8px; padding: 8px 10px; }
    .studio .studio-steps__item:not(.is-current) .studio-steps__text { display: none; }
    .studio .studio-steps__item + .studio-steps__item::before { display: none; }
}

.studio-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
    padding: 14px 18px;
    border: 1px solid var(--accent-line);
    border-radius: var(--r-lg);
    background: var(--accent-soft);
    color: var(--accent-press);
    font-size: 14px;
}
.studio-note span { flex: 1 1 360px; }

/* ------------------------------------------------- étape 1 : écrire */

.compose { grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; }
.compose__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 24px; }
.compose__head .pane-head { flex: 1 1 280px; }
.compose__count { display: flex; justify-content: flex-end; margin-top: -6px; }

/* Commutateur simple / expert : deux boutons d'envoi, l'état courant est appuyé. */
.mode-switch {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    background: var(--surface-3);
}

.mode-switch__option {
    display: grid;
    gap: 1px;
    min-width: 128px;
    padding: 8px 14px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--mute);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.mode-switch__option strong { color: inherit; font-size: 14px; font-weight: 600; }
.mode-switch__option small { color: var(--faint); font-size: 12px; }
.mode-switch__option:hover { color: var(--ink); }
.mode-switch__option.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.mode-switch__option.is-active strong::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.mode-switch__option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-switch__option.is-unavailable { cursor: default; opacity: .7; }

/* Barre d'envoi : coût en essais et bouton, collée en bas pendant l'écriture. */
.compose__bar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 12px 12px 12px 20px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 18px 40px -24px rgba(14, 26, 43, .45);
}
.compose__summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; min-width: 0; color: var(--mute); font-size: 13.5px; }
.compose__cost { color: var(--body); font-weight: 600; }
.compose__saved { display: inline-flex; align-items: center; gap: 6px; }
.compose__saved::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.compose__saved.is-saving::before { background: var(--accent); }
.compose__saved.is-error { color: var(--danger); }
.compose__saved.is-error::before { background: var(--danger); }
.compose .compose__side .picker { max-height: 54vh; }
.pick__listen svg { width: 13px; height: 13px; }

@media (max-width: 1100px) {
    .compose { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
    .mode-switch { display: grid; width: 100%; }
    .mode-switch__option { min-width: 0; }
    .compose__bar { bottom: 8px; padding: 10px 10px 10px 14px; }
    .compose__bar .btn { width: 100%; }
}

/* Blocs du mode expert */
.blocks { display: grid; gap: 14px; }
.block-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 14px 16px 12px;
    border: 1px solid var(--hairline);
    border-left: 4px solid var(--block-1);
    border-radius: var(--r-md);
    background: var(--surface);
}
.block-card--2 { border-left-color: var(--block-2); }
.block-card--3 { border-left-color: var(--block-3); }
.block-card.is-collapsed { display: none; }
.block-card__legend { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; float: left; }
.block-card__legend + * { clear: both; }
.block-card__text { min-height: 96px; font-size: 15.5px; line-height: 1.6; }
.block-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13px; }
.block-card__foot .muted { margin-left: auto; }

.block-tag {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: var(--block-1-soft);
    color: var(--block-1-ink);
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}
.block-tag--2 { background: var(--block-2-soft); color: var(--block-2-ink); }
.block-tag--3 { background: var(--block-3-soft); color: var(--block-3-ink); }

.block-state { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 12.5px; font-weight: 500; }
.block-state svg { width: 14px; height: 14px; }
.block-state--ready { color: var(--ok); }
.block-state--todo { color: var(--warn); }

.seconds-field { display: inline-flex; align-items: center; gap: 8px; color: var(--body); font-size: 13.5px; white-space: nowrap; }
.input--seconds { width: 84px; height: 34px; padding: 0 10px; text-align: right; font-variant-numeric: tabular-nums; }
.blocks__add { justify-self: start; }

/* ---------------------------------------------- table de montage (expert) */

.timeline {
    border-radius: var(--r-xl);
    background: var(--stage);
    color: var(--stage-text);
    box-shadow: var(--shadow-stage);
    scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.timeline__form { display: grid; gap: 18px; margin: 0; padding: 26px 28px 22px; }
.timeline__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 28px; }
.timeline__title { max-width: 70ch; }
.timeline__eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--signal); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.timeline__eyebrow svg { width: 15px; height: 15px; }
.timeline__head h2 { color: var(--stage-text); font-size: 21px; letter-spacing: -.015em; }
.timeline__head p:not(.timeline__eyebrow) { margin-top: 6px; color: var(--stage-mute); font-size: 14px; line-height: 1.55; }
.timeline__transport { align-items: center; gap: 14px; }

.tl-play {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: var(--signal);
    color: var(--on-signal);
    cursor: pointer;
    box-shadow: 0 0 0 7px rgba(242, 181, 68, .14);
    transition: transform .12s var(--ease);
}
.tl-play:hover { transform: scale(1.04); }
.tl-play:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.tl-play .tl-play__pause { display: none; }
.tl-play.is-playing .tl-play__start { display: none; }
.tl-play.is-playing .tl-play__pause { display: block; }
.tl-play.is-loading { opacity: .7; cursor: progress; }
.tl-clock { color: var(--stage-mute); font-size: 15px; }
.tl-clock b { color: var(--stage-text); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }

.js .timeline__stage.js-only { display: block; }
.timeline__stage {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--stage-line);
    border-radius: var(--r-lg);
    background: var(--lane);
    scrollbar-color: var(--stage-line) transparent;
}

.tl-canvas { position: relative; min-width: 100%; padding: 0 0 10px; user-select: none; -webkit-user-select: none; }
.tl-ruler { position: relative; height: 30px; border-bottom: 1px solid var(--stage-line); cursor: pointer; }
.tl-tick { position: absolute; bottom: 0; width: 1px; height: 6px; background: var(--stage-line); }
.tl-tick--major { height: 12px; background: #3a4f70; }
.tl-tick span { position: absolute; bottom: 13px; left: 4px; color: var(--stage-mute); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-lane { position: relative; display: block; height: 96px; margin-top: 8px; }
.tl-lane--music { height: 50px; }
.tl-lane__label {
    position: sticky;
    left: 0;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    margin: 0 0 0 8px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(11, 21, 36, .86);
    color: var(--stage-mute);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    pointer-events: none;
}
.tl-lane__label svg { width: 13px; height: 13px; }

.tl-clip {
    position: absolute;
    top: 26px;
    z-index: 2;
    display: block;
    height: 66px;
    overflow: hidden;
    border: 1px solid var(--block-1);
    border-radius: 10px;
    background: rgba(91, 141, 239, .22);
    color: #fff;
    cursor: grab;
    touch-action: none;
}
.tl-clip--2 { border-color: var(--block-2); background: rgba(47, 181, 154, .22); }
.tl-clip--3 { border-color: var(--block-3); background: rgba(169, 139, 240, .24); }
.tl-clip:hover { box-shadow: 0 0 0 2px rgba(255, 255, 255, .18); }
.tl-clip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tl-clip.is-dragging { cursor: grabbing; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6), 0 0 0 2px rgba(255, 255, 255, .35); }
.tl-clip.is-estimated { border-style: dashed; }
.tl-clip canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; pointer-events: none; }
.tl-clip__label {
    position: absolute;
    top: 4px;
    left: 8px;
    right: 8px;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
    pointer-events: none;
}
.tl-clip__time { position: absolute; bottom: 3px; left: 8px; color: rgba(255, 255, 255, .85); font-size: 11px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); pointer-events: none; white-space: nowrap; }

.tl-bed {
    position: absolute;
    top: 26px;
    left: 0;
    height: 20px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(242, 181, 68, .34), rgba(242, 181, 68, .34) calc(100% - var(--fade, 40px)), rgba(242, 181, 68, 0));
    box-shadow: inset 0 0 0 1px rgba(242, 181, 68, .45);
}
.tl-bed.is-silent { background: repeating-linear-gradient(90deg, rgba(154, 168, 190, .18) 0 6px, transparent 6px 12px); box-shadow: inset 0 0 0 1px var(--stage-line); }
.tl-bed__name { position: absolute; top: 2px; left: 8px; max-width: calc(100% - 16px); overflow: hidden; color: #f6dca6; font-size: 11px; font-weight: 600; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.tl-bed.is-silent .tl-bed__name { color: var(--stage-mute); }

.tl-end {
    position: absolute;
    top: 30px;
    bottom: 0;
    z-index: 4;
    width: 22px;
    margin-left: -11px;
    padding: 0;
    border: 0;
    background: none;
    cursor: ew-resize;
    touch-action: none;
}
.tl-end::before { content: ""; position: absolute; top: 0; bottom: 0; left: 10px; width: 2px; background: var(--signal); }
.tl-end::after { content: ""; position: absolute; bottom: 6px; left: 4px; width: 14px; height: 14px; border-radius: 4px; background: var(--signal); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.tl-end:focus-visible { outline: 2px solid #fff; outline-offset: 0; border-radius: 4px; }

.tl-head { position: absolute; top: 0; bottom: 0; z-index: 5; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; box-shadow: 0 0 0 1px rgba(11, 21, 36, .4); }
.tl-head::before { content: ""; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top: 8px solid #fff; }
.tl-out { position: absolute; top: 30px; bottom: 0; z-index: 1; background: rgba(11, 21, 36, .62); pointer-events: none; }

.timeline__music { display: flex; align-items: center; gap: 8px; margin: -4px 0 0; color: var(--stage-mute); font-size: 13.5px; }
.timeline__music svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--signal); }

/* Réglages précis : surface claire, lisible, utilisable au doigt sur mobile. */
.timeline__fields { display: grid; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); }
.tl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tl-table th, .tl-table td { padding: 8px 10px; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: middle; }
.tl-table thead th { color: var(--faint); font-size: 12.5px; font-weight: 600; }
.tl-table tbody th { font-weight: 400; }
.tl-table tbody tr:last-child > * { border-bottom: 0; }
.tl-row th > * { vertical-align: middle; }
.tl-row__text { display: inline-block; overflow: hidden; max-width: 46ch; margin-left: 10px; color: var(--body); text-overflow: ellipsis; white-space: nowrap; }
.tl-row.is-active > * { background: var(--surface-2); }
.tl-table .num { color: var(--body); white-space: nowrap; }
.tl-total { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-top: 4px; }
.tl-total .seconds-field > span:first-child { color: var(--ink); font-weight: 600; }
.tl-total .field__hint { margin: 0; }

.timeline__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; }
.tl-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.tl-state svg { flex: 0 0 auto; width: 17px; height: 17px; }
.tl-state--ok { color: #8fe0b5; }
.tl-state--todo { color: #f6d58f; }
.tl-hint { flex: 1 1 260px; color: var(--stage-mute); font-size: 12.5px; }
.timeline__foot .btn { margin-left: auto; }

@media (max-width: 1080px) {
    .tl-table { table-layout: fixed; }
    .tl-table tbody th { overflow: hidden; }
    .tl-row__text { max-width: 100%; }
}

@media (max-width: 760px) {
    .timeline__form { padding: 18px 14px 16px; }
    .timeline__head h2 { font-size: 18px; }
    .timeline__fields { padding: 10px; }
    .tl-table thead { display: none; }
    .tl-table, .tl-table tbody { display: block; }
    .tl-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; padding: 12px 4px; border-bottom: 1px solid var(--hairline); }
    .tl-table tbody tr:last-child { border-bottom: 0; }
    .tl-table th, .tl-table td { padding: 0; border: 0; }
    .tl-table tbody th { grid-column: 1 / -1; }
    .tl-table td:nth-child(2)::before { content: "Début "; color: var(--faint); font-size: 12px; }
    .tl-table td:nth-child(3)::before { content: "Écart "; color: var(--faint); font-size: 12px; }
    .tl-table td:nth-child(4)::before { content: "Durée "; color: var(--faint); font-size: 12px; }
    .tl-table td:nth-child(5)::before { content: "Fin "; color: var(--faint); font-size: 12px; }
    .tl-row__text { display: block; max-width: 100%; margin: 6px 0 0; white-space: normal; }
    .timeline__foot .btn { width: 100%; }
}

/* ------------------------------------------------- étape 2 : écoute finale */

.booth-stage__eyebrow { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 4px; color: var(--signal); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.booth-stage__head .booth-stage__eyebrow { margin-top: 0; color: var(--signal); }
.booth-stage__eyebrow svg { width: 14px; height: 14px; }
.booth-stage__foot .inline-form { display: inline-flex; margin: 0; }
.booth-stage__foot .btn svg { width: 15px; height: 15px; }
.finalize-bar__step { display: block; margin-bottom: 4px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.finalize-bar__copy .finalize-bar__hold { margin-top: 8px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.finalize-bar__hold[hidden] { display: none; }

/* ------------------------------------------------------ mes annonces */

.segmented__count { margin-left: 4px; padding: 0 7px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--mute); font-size: 12px; }
.segmented__option input:checked + span .segmented__count { background: var(--accent-soft); color: var(--accent-press); }

.announcement-list__group { padding: 16px 20px 8px; border-bottom: 1px solid var(--hairline); background: var(--surface-2); }
.announcement-list__group h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--mute); font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.announcement-list__group .num { padding: 0 7px; border-radius: var(--r-pill); background: var(--surface-3); font-size: 11.5px; letter-spacing: 0; }
.announcement-list__group[hidden] { display: none; }

.announcement-item { grid-template-columns: 18px 42px minmax(0, 1fr) auto auto; }
.announcement-item__listen { display: grid; place-items: center; }
.announcement-item__main { gap: 4px; }
.announcement-item__excerpt { overflow: hidden; margin: 0; color: var(--mute); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.announcement-item__excerpt.is-empty { color: var(--faint); font-style: italic; }
.announcement-item__meta { gap: 6px 0; }
.announcement-item__fact { display: inline-flex; align-items: center; gap: 4px; }
.announcement-item__fact svg { flex: 0 0 auto; width: 13px; height: 13px; }
.announcement-item__fact--expert { color: var(--ink); font-weight: 600; }
.announcement-item__meta .progress-chip + *::before { content: none; }
.announcement-item__meta .progress-chip { flex: 0 0 auto; margin-right: 10px; }

.row-listen { position: relative; display: grid; place-items: center; }
.js .row-listen__toggle { width: 42px; height: 42px; border-color: var(--stage); background: var(--stage); color: var(--signal); }
.js .row-listen__toggle:hover { border-color: var(--stage); background: var(--rail-3); color: var(--signal); }
.js .row-listen__toggle svg { width: 16px; height: 16px; }
.row-listen--none { width: 42px; height: 42px; border: 1px dashed var(--hairline-strong); border-radius: 50%; color: var(--faint); }
.row-listen--none svg { width: 17px; height: 17px; }
.announcement-item--done .row-listen--none { border-style: solid; border-color: var(--ok-line); color: var(--ok); }
.row-listen .music-preview__error { position: absolute; top: 100%; left: 0; z-index: 3; width: max-content; }
.row-listen audio { width: 150px; }

.progress-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 24px;
    padding: 0 10px 0 8px;
    border-radius: var(--r-pill);
    background: var(--surface-3);
    color: var(--body);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.progress-chip__dots { display: inline-flex; gap: 3px; }
.progress-chip__dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .22; }
.progress-chip__dots i.is-done { opacity: .55; }
.progress-chip__dots i.is-current { opacity: 1; }
.progress-chip--draft, .progress-chip--busy { background: var(--accent-soft); color: var(--accent-press); }
.progress-chip--ready { background: var(--warn-soft); color: var(--warn); }
.progress-chip--warn { background: var(--danger-soft); color: var(--danger); }
.progress-chip--done { padding-left: 10px; background: var(--ok-soft); color: var(--ok); }
.progress-chip--done::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.progress-chip--muted { padding-left: 10px; color: var(--mute); }

@container annonces (max-width: 860px) {
    .announcement-item { grid-template-columns: 18px 42px minmax(0, 1fr) auto; }
}

@container annonces (max-width: 700px) {
    .announcement-item { grid-template-columns: 18px 42px minmax(0, 1fr); }
    .announcement-item .row-actions { grid-column: 3; flex-wrap: wrap; }
    .announcement-item__excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; }
    .announcement-item__meta { flex-wrap: wrap; }
}

/* ------------------------------------------------------ accueil */

.welcome {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    overflow: hidden;
    border-radius: var(--r-xl);
    background: var(--stage);
    color: var(--stage-text);
    box-shadow: var(--shadow-stage);
}
.welcome__copy { position: relative; z-index: 1; display: grid; align-content: start; gap: 14px; padding: 40px 44px 34px; }
.welcome__eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: var(--stage-mute); font-size: 13px; font-weight: 600; letter-spacing: .03em; }
.welcome__title { color: #fff; font-size: 40px; line-height: 1.05; letter-spacing: -.03em; }
.welcome__question { margin: -2px 0 0; color: var(--signal); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.welcome__lede { max-width: 54ch; margin: 0; color: #c9d3e2; font-size: 15px; line-height: 1.6; }
.welcome__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.welcome__starts { display: grid; gap: 8px; margin-top: 8px; }
.welcome__starts-label { margin: 0; color: var(--stage-mute); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.welcome__starts-list { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-start {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px 0 12px;
    border: 1px solid var(--stage-line);
    border-radius: var(--r-pill);
    background: var(--stage-2);
    color: var(--stage-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.quick-start svg { width: 16px; height: 16px; color: var(--signal); }
.quick-start:hover { border-color: #3a4f70; background: var(--rail-3); }
.quick-start:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.welcome__note { margin: 6px 0 0; color: var(--stage-mute); font-size: 13px; }
.welcome__visual { position: relative; min-height: 100%; }
.welcome__visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40%); mask-image: linear-gradient(90deg, transparent 0, #000 40%); }
.welcome__eyebrow .brand-mark { width: 26px; height: 26px; }

@media (max-width: 1000px) {
    .welcome { grid-template-columns: minmax(0, 1fr); }
    .welcome__visual { position: absolute; inset: 0; opacity: .25; }
    .welcome__copy { padding: 30px 24px 26px; }
    .welcome__title { font-size: 32px; }
    .welcome__question { font-size: 19px; }
}

@media (max-width: 520px) {
    .welcome__actions .btn { width: 100%; }
}

.section__lede { margin: 4px 0 0; color: var(--mute); font-size: 14px; }
.resume__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.resume-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-content: start;
    gap: 12px 14px;
    padding: 18px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}
.resume-card > .btn { grid-column: 2; justify-self: start; }
.resume-card h3 { font-size: 15.5px; }
.resume-card h3 a { color: var(--ink); text-decoration: none; }
.resume-card h3 a:hover { color: var(--accent); }
.resume-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 0; color: var(--faint); font-size: 13px; }
.resume-card__excerpt { margin: 8px 0 0; color: var(--mute); font-size: 13.5px; line-height: 1.5; }

.recent-list { margin: 0; padding: 0; list-style: none; }
.recent-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--hairline); }
.recent-item:last-child { border-bottom: 0; }
.recent-item__copy { display: grid; gap: 4px; min-width: 0; }
.recent-item__name { overflow: hidden; color: var(--ink); font-weight: 600; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.recent-item__name:hover { color: var(--accent); }
.recent-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--faint); font-size: 13px; }
.recent-item .row-arrow { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--mute); }
.recent-item .row-arrow:hover { background: var(--surface-3); color: var(--ink); }

@media (max-width: 600px) {
    .recent-item { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 12px 14px; }
    .recent-item > .btn { display: none; }
}

/* ------------------------------------------------- annonce terminée */

.done-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
    align-items: center;
    gap: 24px 36px;
    padding: 34px 36px;
    border-radius: var(--r-xl);
    background: radial-gradient(120% 140% at 100% 0, #1b2f52 0, var(--stage) 55%);
    color: var(--stage-text);
    box-shadow: var(--shadow-stage);
}
.done-hero__copy { display: grid; gap: 12px; min-width: 0; }
.done-hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #8fe0b5; font-size: 13px; font-weight: 600; }
.done-hero__eyebrow svg { width: 16px; height: 16px; }
.done-hero h1 { color: #fff; font-size: 32px; line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere; }
.done-hero__lede { margin: 0; color: #c9d3e2; font-size: 15px; }
.done-hero__downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.btn--signal { border-color: var(--signal); background: var(--signal); color: var(--on-signal); }
.btn--signal:hover { border-color: #f6c56a; background: #f6c56a; }
.done-hero__facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 6px 0 0; }
.done-hero__facts dt { color: var(--stage-mute); font-size: 12.5px; }
.done-hero__facts dd { margin: 2px 0 0; font-weight: 600; }
.done-hero__player .listen { background: var(--stage-2); box-shadow: none; }

@media (max-width: 1000px) {
    .done-hero { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
    .done-hero h1 { font-size: 26px; }
}

.done-blocks { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.done-block { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 12px; }
.done-block .announcement-transcript { grid-column: 1 / -1; margin: 0; }
.done-block__time { color: var(--faint); font-size: 13px; }

.install-tips { padding: 22px 24px; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); }
.install-tips h2 { font-size: 16px; }
.install-tips ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.install-tips li { display: grid; align-content: start; gap: 4px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.install-tips strong { color: var(--ink); font-size: 14px; }
.install-tips span { color: var(--mute); font-size: 13.5px; line-height: 1.5; }

@media (prefers-reduced-motion: no-preference) {
    .block-card:not(.is-collapsed) { animation: block-in .22s var(--ease) both; }
    @keyframes block-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

.input--seconds, .tl-table .num, .done-block__time, .tl-clip__time { font-family: var(--sans); font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* Mes annonces : compteurs dans le sélecteur, ligne d'informations sur deux lignes au besoin. */
.segmented__option > span { display: inline-flex; align-items: center; white-space: nowrap; }
.announcement-item .announcement-item__meta { flex-wrap: wrap; row-gap: 6px; }
.announcement-item .announcement-item__meta > .progress-chip { overflow: visible; flex: 0 0 auto; }
.announcement-item .announcement-item__meta > .announcement-item__fact { flex: 0 1 auto; max-width: 22ch; }
.announcement-item .row-actions__duplicate { width: 34px; padding: 0; }
.announcement-item .row-actions__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.section + .stats, .resume + .section + .stats { margin-top: 28px; }
.install-tips ol { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.segmented__option span.segmented__count { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--r-pill); font-size: 12px; line-height: 1.4; box-shadow: none; }
.announcement-item .announcement-item__meta { column-gap: 14px; } .announcement-item .announcement-item__meta > * + *::before { content: none; } .announcement-item .announcement-item__meta .progress-chip { margin-right: 0; }
@media (max-width: 760px) { .studio-head .page-head__text { flex: 0 1 auto; width: 100%; } }
@media (max-width: 1100px) { .compose .compose__side { order: 0; } .compose .compose__side .picker { max-height: 60vh; } }

/* Page d'accueil publique : le mode expert en une image (illustration statique, aucun son). */
.landing-expert { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 40px; width: min(1120px, calc(100% - 32px)); margin: 88px auto 0; padding: 40px; border-radius: var(--r-xl); background: var(--stage); color: var(--stage-text); box-shadow: var(--shadow-stage); }
.landing-expert__kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--signal); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.landing-expert__kicker svg { width: 16px; height: 16px; }
.landing-expert h2 { color: #fff; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; }
.landing-expert__copy > p:not(.landing-expert__kicker) { margin: 14px 0 0; color: #c9d3e2; font-size: 15.5px; line-height: 1.6; }
.landing-expert .landing-hero__points { margin-top: 18px; }
.demo-timeline { position: relative; display: grid; gap: 10px; padding: 16px 16px 18px; border: 1px solid var(--stage-line); border-radius: var(--r-lg); background: var(--lane); }
.demo-timeline__ruler { display: flex; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid var(--stage-line); color: var(--stage-mute); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.demo-timeline__lane { position: relative; height: 54px; }
.demo-timeline__lane--music { height: 24px; }
.demo-clip { position: absolute; top: 0; height: 54px; padding: 8px 10px; overflow: hidden; border: 1px solid var(--block-1); border-radius: 10px; background: rgba(91, 141, 239, .22); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.demo-clip--1 { left: 12%; width: 18%; }
.demo-clip--2 { left: 52%; width: 15%; border-color: var(--block-2); background: rgba(47, 181, 154, .22); }
.demo-clip--3 { left: 73%; width: 15%; border-color: var(--block-3); background: rgba(169, 139, 240, .24); }
.demo-bed { position: absolute; inset: 0 6% 0 0; padding: 4px 10px; border-radius: 6px; background: linear-gradient(90deg, rgba(242, 181, 68, .34) 85%, rgba(242, 181, 68, 0)); box-shadow: inset 0 0 0 1px rgba(242, 181, 68, .45); color: #f6dca6; font-size: 11px; font-weight: 600; }
.demo-timeline__head { position: absolute; top: 12px; bottom: 12px; left: 38%; width: 2px; background: #fff; opacity: .85; }
@media (max-width: 900px) {
    .landing-expert { grid-template-columns: minmax(0, 1fr); margin-top: 56px; padding: 26px 20px; }
    .landing-expert h2 { font-size: 24px; }
}
.studio-head .page-head__text { flex: 1 1 auto; }
@media (max-width: 1100px) { .studio-head .page-head__text { width: 100%; } }
@media (max-width: 1080px) { .tl-table thead th:first-child { width: 34%; } }
.studio-head__meta { align-self: flex-start; }

/* ---------------------------------------------------------------------
   Table de montage, deuxième version (3 octobre 2026, retours de Seb) :
   musique et volumes dans la table, écoute en direct mise en avant, piste
   musique avec sa forme d'onde, mixage final écouté dans la table.
   --------------------------------------------------------------------- */

.timeline__head .btn { flex: 0 0 auto; }
.timeline__transport { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 4px 0 2px; }
.js .timeline__transport.js-only { display: flex; }
.tl-transport__label { display: grid; gap: 2px; margin-right: auto; }
.tl-transport__label strong { color: var(--stage-text); font-size: 15px; }
.tl-transport__label small { color: var(--stage-mute); font-size: 12.5px; }

.tl-lane--music { height: 74px; }
.tl-bed { height: 44px; overflow: hidden; border-radius: 8px; background: linear-gradient(90deg, rgba(242, 181, 68, .16), rgba(242, 181, 68, .16) calc(100% - var(--fade, 40px)), rgba(242, 181, 68, 0)); box-shadow: inset 0 0 0 1px rgba(242, 181, 68, .4); }
.tl-bed canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tl-bed__name { z-index: 1; padding: 0 6px; border-radius: 4px; background: rgba(11, 21, 36, .7); }

.tl-mixer {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px 24px;
    padding: 14px 16px;
    border: 1px solid var(--stage-line);
    border-radius: var(--r-lg);
    background: var(--stage-2);
}
.tl-music { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 8px; color: var(--stage-text); font-size: 14px; font-weight: 600; }
.tl-music svg { width: 16px; height: 16px; color: var(--signal); }
.tl-music .select { min-width: 0; width: 100%; }
.tl-volume { display: grid; grid-template-columns: auto minmax(0, 1fr) 4.5em; align-items: center; gap: 10px; color: var(--stage-text); font-size: 14px; font-weight: 600; }
.tl-volume input[type="range"] { width: 100%; accent-color: var(--signal); }
.tl-volume output { color: var(--stage-mute); font-size: 13px; text-align: right; }

.tl-final { display: grid; gap: 12px; margin: 0 28px 24px; padding: 18px 18px 16px; border-radius: var(--r-lg); background: var(--stage-2); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.tl-final:focus { outline: none; }
.tl-final__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.tl-final__head .booth-stage__eyebrow { margin: 0; }
.tl-final__head span { color: var(--stage-mute); font-size: 13.5px; }
.tl-final .listen { flex: none; box-shadow: none; background: var(--lane); padding: 14px 16px; }
.tl-final .listen .player__label { display: none; }

@media (max-width: 900px) {
    .tl-mixer { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .tl-final { margin: 0 14px 16px; padding: 14px; }
    .timeline__head .btn { width: 100%; }
}

/* Voix : « Écouter » lit l'extrait sur place, sans lecteur séparé. */
.voice-listen { flex: 0 0 auto; }
.js .voice-listen__toggle { display: inline-flex; width: auto; height: 34px; padding: 0 12px; border-radius: var(--r-sm); }
.js .voice-listen__toggle svg { width: 13px; height: 13px; }
.js .voice-listen__toggle.is-playing { border-color: var(--signal); background: var(--signal); color: var(--on-signal); }
.voice-listen audio { max-width: 220px; }
.voice-listen .music-preview__error { position: absolute; right: 12px; bottom: 6px; }
.pick--compact { position: relative; }

/* Écriture : retour à l'écoute à côté de la génération. */
.compose__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.compose__saved--editing::before { background: var(--hairline-strong); }
.studio .studio-steps__item.is-reachable .studio-steps__link strong { color: var(--accent); }

@media (max-width: 600px) {
    .compose__actions { width: 100%; }
    .compose__actions .btn { width: 100%; }
}

/* ---------------------------------------------------------------------
   Table de mixage, troisième version (3 octobre 2026) : table pour tous,
   musique choisie dans une fenêtre, mode expert dépliable, enregistrer ou
   mixer et finaliser.
   --------------------------------------------------------------------- */

.tl-mixer { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); }
.tl-music { display: block; min-width: 0; color: inherit; font-weight: 400; }
.tl-music > summary { list-style: none; }
.tl-music > summary::-webkit-details-marker { display: none; }
.tl-music__button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 10px;
    border: 1px solid #3a4f70;
    border-radius: var(--r-md);
    background: var(--lane);
    cursor: pointer;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.tl-music__button:hover { border-color: var(--signal); }
.tl-music__button:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.tl-music__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--signal); color: var(--on-signal); }
.tl-music__icon svg { width: 20px; height: 20px; }
.tl-music__text { display: grid; gap: 1px; min-width: 0; }
.tl-music__text small { color: var(--stage-mute); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tl-music__text strong { overflow: hidden; color: #fff; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.tl-music__text span { overflow: hidden; color: var(--stage-mute); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.tl-music__change { padding: 6px 12px; border-radius: var(--r-pill); background: var(--stage-2); color: var(--signal); font-size: 13px; font-weight: 700; }
.tl-music[open] > div { margin-top: 12px; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); }

/* Fenêtre de choix de la musique */
.music-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(86vh, 900px); padding: 0; }
.music-dialog .dialog__inner { padding: 0; }
.music-picker { display: grid; gap: 14px; padding: 22px 24px 24px; }
.music-picker__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.music-picker__head h2 { font-size: 20px; letter-spacing: -.01em; }
.music-picker__head p { margin: 4px 0 0; color: var(--mute); font-size: 14px; }
.music-picker__list { display: grid; gap: 8px; max-height: 56vh; overflow-y: auto; padding: 2px; }
.music-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    background: var(--surface);
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.music-option:hover { border-color: var(--hairline-strong); background: var(--surface-2); }
.music-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.music-option.is-filtered, .music-option.is-tag-hidden { display: none; }
.music-option__body { display: grid; gap: 3px; min-width: 0; cursor: pointer; }
.music-option__body strong { color: var(--ink); font-size: 15px; }
.music-option__icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px dashed var(--hairline-strong); border-radius: 50%; color: var(--mute); }
.music-option__radio { width: 18px; height: 18px; accent-color: var(--accent); }
.js .music-option__radio { display: none; }
.js .music-option__pick.js-only { display: inline-flex; }
.music-option.is-selected .music-option__pick { border-color: var(--accent); color: var(--accent-press); }
.music-picker .music-toolbar { margin: 0; }

/* Mode expert : réglages précis dépliables sous la table */
.tl-expert { border: 1px solid var(--stage-line); border-radius: var(--r-lg); background: var(--stage-2); }
.tl-expert > summary { list-style: none; cursor: pointer; }
.tl-expert > summary::-webkit-details-marker { display: none; }
.tl-expert__summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.tl-expert__summary > span { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.tl-expert__summary svg { width: 16px; height: 16px; color: var(--signal); }
.tl-expert__summary strong { color: #fff; font-size: 14.5px; }
.tl-expert__summary small { color: var(--stage-mute); font-size: 13px; }
.tl-expert__summary::after { content: "+"; color: var(--stage-mute); font-size: 20px; line-height: 1; }
.tl-expert[open] > .tl-expert__summary::after { content: "−"; }
.tl-expert .timeline__fields { margin: 0 12px 12px; }

.timeline__foot { gap: 10px 14px; }
.timeline__foot .tl-state { margin-right: auto; }
.timeline__foot .btn { margin-left: 0; }
.tl-state--warn { color: #ffb4a8; }
.tl-cost { margin: -6px 0 0; color: var(--stage-mute); font-size: 12.5px; text-align: right; }
.tl-warning { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: var(--r-md); background: rgba(242, 181, 68, .12); color: #f6d58f; font-size: 14px; font-weight: 600; }
.tl-warning svg { flex: 0 0 auto; width: 16px; height: 16px; }

@media (max-width: 900px) {
    .tl-mixer { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .timeline__foot .btn { width: 100%; }
    .tl-cost { text-align: left; }
    .music-option { grid-template-columns: auto minmax(0, 1fr); }
    .music-option .music-option__pick { grid-column: 2; justify-self: start; }
    .music-picker { padding: 18px 16px 20px; }
}
.tl-music .tl-music__icon svg { width: 20px; height: 20px; color: var(--on-signal); }
.music-picker__head { margin: -22px -24px 0; padding: 22px 24px 20px; background: radial-gradient(120% 160% at 100% 0, #1b2f52 0, var(--stage) 60%); color: var(--stage-text); }
.music-picker__head h2 { display: flex; align-items: center; gap: 10px; color: #fff; }
.music-picker__head h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 5px rgba(242, 181, 68, .18); }
.music-picker__head p { color: var(--stage-mute); }
.music-picker__head .btn { border-color: var(--stage-line); color: var(--stage-text); }
.music-picker__head .btn:hover { background: var(--stage-2); color: #fff; }
.music-option .music-preview__toggle { width: 44px; height: 44px; }
@media (max-width: 760px) { .music-picker__head { margin: -18px -16px 0; padding: 18px 16px; } }

/* Studio : la table de mixage prend toute la largeur disponible. */
.page:has(.studio-head) { max-width: 1680px; }

/* ---------------------------------------------------------------------
   Studio unique (3 octobre 2026, après-midi) : la table de mixage est
   l'espace de travail ; texte et voix dans une fenêtre posée dessus ;
   encarts Texte, Voix et Musique dans la table.
   --------------------------------------------------------------------- */

/* Encarts de la table */
.tl-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tl-source, .tl-sources .tl-music__button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 10px 12px 10px 10px;
    border: 1px solid #3a4f70;
    border-radius: var(--r-md);
    background: var(--lane);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s var(--ease);
}
.tl-source:hover { border-color: var(--signal); }
.tl-source:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.tl-source__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--stage-2); color: var(--signal); box-shadow: inset 0 0 0 1px var(--stage-line); }
.tl-source__icon svg { width: 20px; height: 20px; }
.tl-sources .tl-music[open] > div { grid-column: 1 / -1; }
.tl-mixer--volumes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tl-warning a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1100px) {
    .tl-sources { grid-template-columns: minmax(0, 1fr); }
    .tl-mixer--volumes { grid-template-columns: minmax(0, 1fr); }
}

/* Fenêtre « Texte et voix » */
.composer-sheet.is-dialog { display: none; }
.composer-sheet > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    padding: 10px 16px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.composer-sheet > summary::-webkit-details-marker { display: none; }
.composer-sheet[open] > summary { margin-bottom: 12px; }

.composer-dialog { width: min(1180px, calc(100vw - 32px)); max-height: 94vh; padding: 0; border-radius: var(--r-xl); }
.composer-dialog .dialog__inner { padding: 0; }
.composer-dialog::backdrop { background: rgba(8, 15, 27, .62); }

.compose--sheet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 0;
    margin: 0;
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    background: var(--surface);
    overflow: clip;
}
.composer-dialog .compose--sheet { border: 0; }
.compose__sheet-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px 20px;
    background: radial-gradient(120% 160% at 100% 0, #1b2f52 0, var(--stage) 60%);
    color: var(--stage-text);
}
.compose__eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--signal); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.compose__eyebrow svg { width: 15px; height: 15px; }
.compose__sheet-head h2 { color: #fff; font-size: 24px; letter-spacing: -.02em; }
.compose__sheet-head p:not(.compose__eyebrow) { max-width: 70ch; margin: 6px 0 0; color: #c9d3e2; font-size: 14.5px; line-height: 1.55; }
.compose__sheet-head .btn { flex: 0 0 auto; border-color: var(--stage-line); color: var(--stage-text); }
.compose__sheet-head .btn:hover { background: var(--stage-2); color: #fff; }
.compose__sheet-body { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.compose--sheet .compose__main { padding: 22px 28px; }
.compose--sheet .compose__side { padding: 22px 22px; border-left: 1px solid var(--hairline); background: var(--surface-2); }
.compose--sheet .compose__side .picker { max-height: 46vh; }
.compose__side-title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 16px; }
.compose__side-title svg { width: 16px; height: 16px; color: var(--accent); }
.compose--sheet .compose__bar { position: sticky; bottom: 0; grid-column: 1 / -1; margin: 0; border-width: 1px 0 0; border-radius: 0; box-shadow: 0 -12px 24px -20px rgba(14, 26, 43, .5); }
.compose--sheet .block-card__text { min-height: 120px; }

/* Un seul texte : pas de mention « Bloc 1 » ; elle apparaît avec un second bloc. */
.blocks:not(.has-several) .block-tag { display: none; }
.blocks:not(.has-several) .block-card { border-left-color: var(--hairline); }
.blocks__hint { margin: 0; }

@media (max-width: 900px) {
    .compose__sheet-body { grid-template-columns: minmax(0, 1fr); }
    .compose--sheet .compose__side { border-left: 0; border-top: 1px solid var(--hairline); }
    .compose__sheet-head { padding: 20px 18px 16px; }
    .compose--sheet .compose__main, .compose--sheet .compose__side { padding: 18px; }
    .composer-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
}
.compose.compose--sheet { display: block; }
/* Voix dans la fenêtre : nom et description, puis « Écouter » dessous. */
.compose--sheet .pick--compact { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px 12px; }
.compose--sheet .pick--compact > input { margin-top: 3px; }
.compose--sheet .pick--compact .voice-listen, .compose--sheet .pick--compact .pick__audio { grid-column: 2; justify-self: start; }

/* ---------------------------------------------------------------------
   Table de mixage, proportions (3 octobre 2026, après-midi) : écoute en
   haut à droite, pistes plus généreuses, encart « Texte et voix » puis
   musique à gauche, volumes à droite ; invitation à choisir la musique.
   --------------------------------------------------------------------- */

.studio-head__title { margin: 0; font-size: 30px; letter-spacing: -.025em; }
.timeline__head { align-items: center; }
.timeline__head .timeline__transport { display: none; }
.js .timeline__head .timeline__transport.js-only { display: flex; flex-direction: row; align-items: center; gap: 14px; flex-wrap: nowrap; padding: 0; }
.timeline__head .tl-transport__label { margin-right: 0; text-align: right; }
.timeline__head .tl-clock { order: 0; }

.tl-lane--voice { height: 112px; }
.tl-clip { top: 30px; height: 74px; }
.tl-clip__label { font-size: 13px; top: 6px; }
.tl-clip__time { bottom: 5px; font-size: 11.5px; }
.tl-lane--music { height: 84px; }
.tl-bed { top: 28px; height: 52px; }

.tl-console { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.tl-console .tl-sources { grid-template-columns: minmax(0, 1fr); align-content: start; }
.tl-console .tl-mixer--volumes { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 18px; padding: 18px 20px; }
.tl-mixer__title { margin: 0; color: var(--stage-mute); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tl-console .tl-volume { grid-template-columns: 5.5em minmax(0, 1fr) 4.5em; }

.tl-music.is-invited > .tl-music__button { border-color: var(--signal); box-shadow: 0 0 0 4px rgba(242, 181, 68, .16); }
.tl-music.is-invited .tl-music__change { background: var(--signal); color: var(--on-signal); }
.tl-invite { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border-radius: var(--r-md); background: rgba(242, 181, 68, .12); color: #f6dca6; font-size: 13.5px; line-height: 1.45; }
.tl-invite strong { color: #fff; }
.tl-invite svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--signal); transform: rotate(-90deg); }

@media (prefers-reduced-motion: no-preference) {
    .tl-music.is-invited > .tl-music__button { animation: invite-glow 1.8s var(--ease) infinite; }
    .tl-invite svg { animation: invite-nudge 1.2s var(--ease) infinite; }
    @keyframes invite-glow { 0%, 100% { box-shadow: 0 0 0 3px rgba(242, 181, 68, .14); } 50% { box-shadow: 0 0 0 8px rgba(242, 181, 68, .06); } }
    @keyframes invite-nudge { 0%, 100% { transform: rotate(-90deg) translateX(0); } 50% { transform: rotate(-90deg) translateX(4px); } }
}

@media (max-width: 1000px) {
    .tl-console { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .js .timeline__head .timeline__transport.js-only { width: 100%; justify-content: space-between; }
    .timeline__head .tl-transport__label { display: none; }
    .studio-head__title { font-size: 24px; }
}
.timeline__head .timeline__transport { margin-left: auto; }
.timeline__head .timeline__title { flex: 1 1 360px; }
@media (min-width: 1000px) { .timeline__head { flex-wrap: nowrap; } }

/* Volumes rangés dans le mode expert ; encarts sur toute la largeur. */
.tl-console { grid-template-columns: minmax(0, 1fr); }
.tl-expert .tl-mixer--volumes { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 12px 28px; margin: 0 12px 12px; padding: 14px 18px; border: 1px solid var(--stage-line); border-radius: var(--r-lg); background: var(--lane); }
.tl-expert .tl-mixer__title { margin: 0; }
@media (max-width: 900px) { .tl-expert .tl-mixer--volumes { grid-template-columns: minmax(0, 1fr); } }

/* Encarts « Texte et voix » et « Musique » : deux tuiles distinctes, côte à côte. */
.tl-console .tl-sources { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tl-console .tl-invite { grid-column: 2; }
.tl-sources .tl-source, .tl-sources .tl-music__button { min-height: 76px; padding: 14px 14px 14px 14px; border-radius: var(--r-lg); }
.tl-sources .tl-source { border-color: rgba(91, 141, 239, .45); background: linear-gradient(135deg, rgba(91, 141, 239, .14), rgba(91, 141, 239, .04) 60%), var(--lane); }
.tl-sources .tl-source:hover { border-color: var(--block-1); }
.tl-sources .tl-source__icon { background: var(--block-1); color: #fff; box-shadow: none; }
.tl-sources .tl-source .tl-music__change { color: #fff; background: rgba(91, 141, 239, .28); }
.tl-sources .tl-music__button { border-color: rgba(242, 181, 68, .45); background: linear-gradient(135deg, rgba(242, 181, 68, .14), rgba(242, 181, 68, .03) 60%), var(--lane); }
.tl-sources .tl-music__button:hover { border-color: var(--signal); }
.tl-sources .tl-music__text strong { font-size: 15.5px; }

@media (max-width: 900px) {
    .tl-console .tl-sources { grid-template-columns: minmax(0, 1fr); }
    .tl-console .tl-invite { grid-column: 1; }
}

/* Fenêtre de confirmation aux couleurs du studio */
.confirm-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--surface); box-shadow: 0 30px 80px -30px rgba(8, 15, 27, .7); }
.confirm-dialog::backdrop { background: rgba(8, 15, 27, .55); }
.confirm-dialog__inner { display: grid; justify-items: start; gap: 10px; margin: 0; padding: 26px 26px 22px; }
.confirm-dialog__icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 4px; border-radius: 14px; background: var(--stage); color: var(--signal); }
.confirm-dialog--danger .confirm-dialog__icon { background: var(--danger-soft); color: var(--danger); }
.confirm-dialog__title { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.confirm-dialog__text { margin: 0; color: var(--body); font-size: 15px; line-height: 1.55; }
.confirm-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; width: 100%; margin-top: 12px; }
@media (prefers-reduced-motion: no-preference) {
    .confirm-dialog[open] { animation: confirm-in .18s var(--ease) both; }
    @keyframes confirm-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
}

/* ---------------------------------------------------------------------
   Mode expert, deuxième version : une bande par bloc à la couleur de son
   clip, champs de secondes avec « − » et « + », durée totale et volumes
   en tuiles. Même univers sombre que la table.
   --------------------------------------------------------------------- */

.tl-expert__summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; }
.tl-expert__summary::after { content: none; }
.tl-expert__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--stage-2); color: var(--signal); box-shadow: inset 0 0 0 1px var(--stage-line); }
.tl-expert__icon svg { width: 18px; height: 18px; }
.tl-expert__label { display: grid; gap: 1px; }
.tl-expert__label strong { color: #fff; font-size: 15px; }
.tl-expert__label small { color: var(--stage-mute); font-size: 12.5px; }
.tl-expert__toggle { width: 30px; height: 30px; border-radius: 50%; background: var(--stage-2); box-shadow: inset 0 0 0 1px var(--stage-line); position: relative; }
.tl-expert__toggle::before { content: ""; position: absolute; top: 11px; left: 10px; width: 8px; height: 8px; border-right: 2px solid var(--stage-text); border-bottom: 2px solid var(--stage-text); transform: rotate(45deg); transition: transform .2s var(--ease); }
.tl-expert[open] .tl-expert__toggle::before { top: 13px; transform: rotate(-135deg); }

.xp { display: grid; gap: 14px; padding: 4px 14px 16px; }
.xp__title { margin: 0 0 8px; color: var(--stage-mute); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.xp__hint { margin: 0; color: var(--stage-mute); font-size: 12.5px; }
.xp-blocks { display: grid; gap: 10px; }

.xp-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 20px;
    padding: 12px 14px 12px 16px;
    border: 1px solid var(--stage-line);
    border-left: 4px solid var(--block-1);
    border-radius: var(--r-md);
    background: var(--lane);
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.xp-block--2 { border-left-color: var(--block-2); }
.xp-block--3 { border-left-color: var(--block-3); }
.xp-block.is-active { background: #101d31; border-color: #3a4f70; }
.xp-block__head { display: grid; gap: 3px; min-width: 0; }
.xp-block__tag { color: #fff; font-size: 14px; font-weight: 700; }
.xp-block__text { overflow: hidden; color: #c9d3e2; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.xp-block__span { color: var(--stage-mute); font-size: 12.5px; }
.xp-block__span span { color: var(--stage-text); }
.xp-block__controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; }

.xp-field { display: grid; gap: 5px; }
.xp-field__label { color: var(--stage-mute); font-size: 12px; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; height: 40px; border: 1px solid #3a4f70; border-radius: 10px; background: var(--stage-2); overflow: hidden; }
.stepper:focus-within { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(242, 181, 68, .18); }
.stepper__button { width: 38px; height: 100%; border: 0; background: transparent; color: var(--stage-text); font-size: 18px; font-weight: 600; cursor: pointer; }
.js .stepper__button.js-only { display: inline-block; }
.stepper__button:hover { background: var(--rail-3); color: var(--signal); }
.stepper__button:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.stepper__input { width: 64px; height: 100%; padding: 0 2px; border: 0; background: transparent; color: #fff; font: inherit; font-size: 16px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.stepper__input:focus { outline: none; }
.stepper__input[aria-invalid="true"] { color: #ffb4a8; }
.stepper__unit { padding: 0 8px 0 4px; color: var(--stage-mute); font-size: 14px; }

.xp__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 12px; }
.xp-card { display: grid; align-content: start; gap: 10px; padding: 14px 16px; border: 1px solid var(--stage-line); border-radius: var(--r-md); background: var(--lane); }
.xp-card .xp__title { margin: 0; }
.xp-card__hint { margin: 0; color: var(--stage-mute); font-size: 12.5px; }
.xp-card .tl-volume { grid-template-columns: 5.5em minmax(0, 1fr) 4.5em; }

@media (max-width: 900px) {
    .xp-block { grid-template-columns: minmax(0, 1fr); }
    .xp__grid { grid-template-columns: minmax(0, 1fr); }
    .xp-block__text { white-space: normal; }
}
.tl-expert > .tl-expert__summary::after, .tl-expert[open] > .tl-expert__summary::after { content: none; }
.xp-field { justify-items: start; }
.js .stepper__button.js-only { display: grid; place-items: center; padding: 0; line-height: 1; }
.stepper__input { width: 58px; }

/* Fenêtre « Texte et voix » : hauteur fixe, pas d'ascenseur sur la fenêtre elle-même.
   Le texte et la liste des voix défilent chacun dans leur colonne ; l'en-tête et la
   barre « Générer » restent en place. */
.composer-dialog[open] { display: flex; flex-direction: column; height: min(880px, calc(100vh - 32px)); max-height: calc(100vh - 32px); overflow: hidden; }
.composer-dialog .dialog__inner,
.composer-dialog [data-composer-content] { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 0; }
.composer-dialog .compose.compose--sheet { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; height: 100%; }
.composer-dialog .compose__sheet-head,
.composer-dialog .compose__bar { flex: 0 0 auto; }
.composer-dialog .compose__bar { position: static; }
.composer-dialog .compose__sheet-body { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.composer-dialog .compose--sheet .compose__main { min-height: 0; overflow-y: auto; }
.composer-dialog .compose--sheet .compose__side { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.composer-dialog .compose--sheet .compose__side .picker { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }

/* Petit écran : une seule colonne, c'est le corps de la fenêtre qui défile. */
@media (max-width: 900px) {
    .composer-dialog[open] { height: 100dvh; max-height: 100dvh; }
    .composer-dialog .compose__sheet-body { display: block; overflow-y: auto; }
    .composer-dialog .compose--sheet .compose__main { overflow: visible; }
    .composer-dialog .compose--sheet .compose__side { display: block; overflow: visible; }
    .composer-dialog .compose--sheet .compose__side .picker { max-height: none; overflow: visible; }
}
.composer-dialog .compose.compose--sheet { align-items: stretch; }
.composer-dialog .compose--sheet .compose__side .picker > * { flex-shrink: 0; }
.composer-dialog .compose--sheet .compose__side .picker { grid-auto-rows: max-content; align-content: start; }

/* ------------------------------------------ sociétés, clients et utilisateurs
   Même identité que le studio : en-tête marine pour la société, listes claires,
   un seul chiffre clé par ligne, l'action définitive rangée en bas de page. */

.monogram {
    display: inline-grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-press);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
}

.monogram--lg {
    flex-basis: 60px;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(145deg, #2f6df0, #1a47a8);
    color: #fff;
    font-size: 21px;
    box-shadow: 0 12px 24px -14px rgba(31, 91, 216, .9);
}

.monogram--sm { flex-basis: 28px; width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.monogram--person { border-radius: 50%; background: var(--surface-3); color: var(--body); }

/* Liste des clients : un bandeau de synthèse, puis une ligne par société. */
.org-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 20px;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--stage);
    color: var(--stage-text);
    box-shadow: var(--shadow-stage);
}

.org-summary__item { display: grid; align-content: start; gap: 8px; padding: 20px 24px; border-left: 1px solid var(--stage-line); }
.org-summary__item:first-child { border-left: 0; }
.org-summary__item span { color: var(--stage-mute); font-size: 13px; font-weight: 600; }
.org-summary__item strong { color: #fff; font-size: 30px; line-height: 1; letter-spacing: -.02em; }

.org-list { overflow: hidden; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.org-list__bar { display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--hairline); background: var(--surface-2); }
.org-list__bar .list-filters__search { flex: 0 1 380px; }
.org-list__count { margin-left: auto; color: var(--faint); font-size: 13.5px; white-space: nowrap; }
.org-list__count b { color: var(--ink); font-weight: 600; }
.org-list__rows { margin: 0; padding: 0; list-style: none; }
.org-list__empty { margin: 0; padding: 28px 18px; color: var(--mute); text-align: center; }

.org-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 28px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hairline);
    transition: background .15s var(--ease);
}

.org-row:last-child { border-bottom: 0; }
.org-row:hover { background: var(--surface-2); }
.org-row.is-filtered { display: none; }
.org-row__main { display: flex; align-items: center; gap: 14px; min-width: 0; color: inherit; text-decoration: none; }
.org-row__copy { display: grid; gap: 3px; min-width: 0; }
.org-row__name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ink); font-size: 15.5px; font-weight: 600; }
.org-row__main:hover .org-row__name { color: var(--accent); }
.org-row__meta { color: var(--mute); font-size: 13.5px; }
.org-row__balance { display: grid; justify-items: end; min-width: 104px; text-align: right; }
.org-row__balance strong { color: var(--ink); font-size: 22px; line-height: 1.1; letter-spacing: -.01em; }
.org-row__balance span { color: var(--mute); font-size: 12.5px; }
.org-row__balance small { color: var(--accent-press); font-size: 12px; font-weight: 600; }
.org-row__actions { display: flex; gap: 8px; }

/* En-tête d'une société : marine, comme l'accueil du studio. */
.org-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px 32px;
    margin: 0 0 24px;
    padding: 28px 32px;
    border-radius: var(--r-xl);
    background: radial-gradient(120% 160% at 100% 0%, #1c3a6c 0%, var(--stage) 58%);
    color: var(--stage-text);
    box-shadow: var(--shadow-stage);
}

.org-hero__identity { display: flex; align-items: center; gap: 18px; min-width: 0; }
.org-hero__text { min-width: 0; }
.org-hero__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; color: var(--stage-mute); font-size: 13px; font-weight: 600; letter-spacing: .03em; }
.org-hero__eyebrow a { color: #dbe5f5; }
.org-hero__title { margin: 0; color: #fff; font-size: 32px; line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere; }
.org-hero__meta { margin: 6px 0 0; color: #c9d3e2; font-size: 14.5px; }
.org-hero__balance { display: grid; justify-items: end; text-align: right; }
.org-hero__balance strong { color: #fff; font-size: 44px; line-height: 1; letter-spacing: -.03em; }
.org-hero__balance span { margin-top: 6px; color: #dbe5f5; font-size: 14px; font-weight: 600; }
.org-hero__balance small { margin-top: 2px; color: var(--stage-mute); font-size: 13px; }
.org-hero__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding-top: 18px; border-top: 1px solid var(--stage-line); }
.org-hero:not(:has(.org-hero__balance)) .org-hero__actions { grid-column: auto; padding-top: 0; border-top: 0; }

.org-rename { position: relative; }
.org-rename > summary { list-style: none; cursor: pointer; }
.org-rename > summary::-webkit-details-marker { display: none; }
.org-rename[open] > summary { border-color: var(--stage-mute); background: var(--stage-2); color: #fff; }

.org-rename__form {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    display: grid;
    gap: 8px;
    width: min(380px, 84vw);
    margin: 0;
    padding: 14px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-2);
}

.org-hero:not(:has(.org-hero__balance)) .org-rename__form { right: 0; left: auto; }
.org-rename__label { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.org-rename__row { display: flex; gap: 8px; }
.org-rename__row .input { flex: 1 1 auto; min-width: 0; height: 36px; }

/* Fiche client : transfert à gauche, l'essentiel à droite. */
.org-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 20px; margin-bottom: 32px; }
.org-layout > .card { margin: 0; }
.credit-move { display: grid; gap: 10px; margin: 0; }
.credit-move__label { color: var(--ink); font-size: 14px; font-weight: 600; }
.credit-move__row { display: flex; flex-wrap: wrap; gap: 10px; }
.credit-move__input { width: 140px; height: 46px; font-size: 20px; font-weight: 600; }
.credit-move__row .btn { height: 46px; }
.credit-move__reason { flex: 1 1 200px; min-width: 0; height: 40px; }
.credit-move .field__hint { margin: 0; }
.credit-move--recover .credit-move__input { width: 110px; height: 40px; font-size: 16px; }
.credit-move--recover .credit-move__row .btn { height: 40px; }
.org-credit .credit-more { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.org-credit .credit-more > summary { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.org-credit .credit-more > summary svg { width: 14px; height: 14px; transition: transform .15s var(--ease); }
.org-credit .credit-more[open] > summary svg { transform: rotate(180deg); }

.org-facts .card__body { padding-top: 6px; padding-bottom: 6px; }
.org-facts__list { display: grid; margin: 0; }
.org-facts__list > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.org-facts__list > div:last-child { border-bottom: 0; }
.org-facts__list dt { color: var(--mute); font-size: 14px; }
.org-facts__list dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.org-facts__list dd .muted { font-weight: 400; }

.danger-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    margin-top: 32px;
    padding: 18px 22px;
    border: 1px dashed var(--danger-line);
    border-radius: var(--r-lg);
    background: var(--surface);
}

.danger-zone h2 { margin: 0; font-size: 15.5px; }
.danger-zone p { max-width: 64ch; margin: 4px 0 0; color: var(--mute); font-size: 14px; }

/* Utilisateurs : une personne par ligne, son état en clair. */
.org-people { margin: 0; }
.people { margin: 0; padding: 0; list-style: none; }
.person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--hairline); }
.person:last-child { border-bottom: 0; }
.person__copy { display: grid; gap: 2px; min-width: 0; }
.person__name { color: var(--ink); font-weight: 600; }
.person__email { overflow: hidden; color: var(--mute); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.person__status { display: grid; justify-items: end; gap: 4px; text-align: right; }
.person__status small { color: var(--faint); font-size: 12.5px; }
.person--managed { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.person__you { margin-left: 6px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-press); font-size: 12px; font-weight: 600; }
.person__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 150px; }
.person__actions form { margin: 0; }
.person__menu { width: min(340px, 86vw); padding: 12px; gap: 10px; }
.person__rename { display: grid; gap: 6px; padding: 2px 2px 4px; }
.person__menu .row-menu__section { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--hairline); }
.person__self-hint { margin: 4px 10px; }
.org-people + .org-history, .org-layout + .org-people { margin-top: 0; }
.org-people { margin-bottom: 32px; }
.page-head .org-rename__form { right: 0; left: auto; }

.org-hero ~ .alert { margin-bottom: 20px; }

/* Formulaires guidés : la saisie à gauche, ce qui va se passer à droite. */
.guided-form { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); align-items: start; gap: 24px; max-width: 1080px; }
.guided-form__card { margin: 0; }
.guide { padding: 24px; border-radius: var(--r-lg); background: var(--stage); color: var(--stage-text); box-shadow: var(--shadow-stage); }
.guide .guide__title { margin: 0 0 18px; color: var(--stage-mute); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.guide__steps { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.guide__steps li { display: flex; gap: 14px; }
.guide__number { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; }
.guide strong { color: #fff; font-size: 15px; }
.guide p { margin: 3px 0 0; color: #c9d3e2; font-size: 14px; line-height: 1.5; }

.done-card { display: grid; justify-items: start; gap: 14px; max-width: 720px; padding: 32px; }
.done-card__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.done-card__icon svg { width: 28px; height: 28px; }
.done-card__title { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.done-card__text { margin: 0; color: var(--body); }
.done-card__link { width: 100%; }
.done-card .alert { width: 100%; margin: 0; }
.done-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1 1 auto; min-width: 0; font-size: 13px; }

@media (max-width: 1100px) {
    .org-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .org-summary__item:nth-child(3) { border-left: 0; }
    .org-summary__item:nth-child(n+3) { border-top: 1px solid var(--stage-line); }
    .org-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .guided-form { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
    .org-hero { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
    .org-hero__balance { justify-items: start; text-align: left; }
    .org-hero__balance strong { font-size: 36px; }
    .org-hero__title { font-size: 24px; }
    .monogram--lg { flex-basis: 48px; width: 48px; height: 48px; border-radius: 14px; font-size: 17px; }
    .org-hero:not(:has(.org-hero__balance)) .org-rename__form { right: auto; left: 0; }
    .org-summary__item { padding: 16px 18px; }
    .org-summary__item strong { font-size: 24px; }
    .org-list__bar { flex-wrap: wrap; padding: 12px 14px; }
    .org-list__bar .list-filters__search { flex: 1 1 100%; }
    .org-list__count { margin-left: 0; }
    .org-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; padding: 14px; }
    .org-row__actions { grid-column: 1 / -1; }
    .org-row__actions .btn { flex: 1 1 0; justify-content: center; }
    .org-people .card__head { flex-wrap: wrap; }
    .person { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; }
    .person__status { grid-column: 2; justify-items: start; text-align: left; }
    .person__actions { grid-column: 2; justify-content: flex-start; min-width: 0; }
    /* Sur téléphone, le menu d'une personne s'ouvre en bas de l'écran. */
    .person .row-menu__panel { position: fixed; top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; z-index: 60; }
    .page-head .org-rename__form { right: auto; left: 0; }
    .credit-move__input { flex: 1 1 100px; }
    .done-card { padding: 24px 20px; }
    .copy-field { flex-wrap: wrap; }
}
