/* Module audioguide : CSS extrait d'argon-app.css (scripts/extract_module_css.py). Feuille du module : editer ici, avec les variables de static/css/app/tokens.css. */
.audioguide-toolbar{
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #dfe6f2;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    overflow: visible;
}

.audioguide-toolbar-group{
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: max-content;
}

.audioguide-toolbar-group-label{
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mv-gray-500);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 2px;
    white-space: nowrap;
}

.audioguide-toolbar-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    font-size: 0.73rem;
    font-weight: 600;
    line-height: 1;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    box-shadow: none !important;
}

.audioguide-toolbar-btn svg{
    flex-shrink: 0;
}

.audioguide-toolbar .btn-primary.audioguide-toolbar-btn{
    background: var(--mv-primary);
    border-color: var(--mv-primary);
}

.audioguide-toolbar .btn:hover,
.audioguide-toolbar .btn:active{
    transform: none;
}

.audioguide-toolbar-btn--subtle{
    background: #f3f6fb;
    color: var(--mv-gray-700);
    border-color: #d8e2f1;
}

.audioguide-toolbar-btn--subtle:hover{
    background: #e9eff8;
    color: #1f2937;
    border-color: #bfd0e8;
}

.audioguide-toolbar-player{
    flex: 1 1 100%;
    min-width: 220px;
    order: 5;
}

.audioguide-toolbar-player .card-body{
    padding: 0.42rem 0.5rem !important;
}

.audioguide-toolbar-player .btn.btn-xs{
    border-radius: 999px;
    min-height: 28px;
    padding: 0 0.65rem;
    min-width: 0;
}

.audioguide-waveform{
    min-width: 0;
}

.audioguide-toolbar-player #noAudioguideMessage{
    display: flex;
    align-items: center;
    margin-bottom: 0 !important;
    min-height: 32px;
    padding-left: 10px;
}

.audioguide-toolbar-side{
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: max-content;
}

.audioguide-sidenav-toggle-btn{
    white-space: nowrap;
}

.audioguide-sidenav-toggle-btn:hover{
    color: inherit;
}

.audioguide-sidenav-toggle-icon{
    width: 14px;
    height: 14px;
    display: inline-block;
}

.audioguide-sidenav-toggle-icon svg{
    width: 10px;
    height: 10px;
    transition: transform 0.2s ease;
}

.audioguide-sidenav-toggle-btn.is-collapsed .audioguide-sidenav-toggle-icon svg{
    transform: rotate(180deg);
}

.audioguide-workspace{
    --audioguide-side-width: 30%;
    --audioguide-side-collapsed: 44px;
    --bs-gutter-x: 0.35rem;
    align-items: stretch;
}

.audioguide-workspace.is-resizing{
    user-select: none;
}

.audioguide-panel-is-resizing *{
    cursor: col-resize !important;
}

/* Ecran etroit : le panneau audio passe sous le script, detache du bouton
   « Compiler l'audioguide ». */
@media (max-width: 767.98px) {
    .audioguide-workspace > .audioguide-side-column{
        margin-top: 24px;
    }
}

@media (min-width: 768px) {
    .audioguide-workspace{
        display: flex;
        flex-wrap: nowrap !important;
        gap: 0;
        align-items: flex-start;
    }

    .audioguide-workspace > .audioguide-main-column{
        flex: 1 1 auto;
        min-width: 0;
        width: calc(100% - var(--audioguide-side-width) - 6px);
        max-width: calc(100% - var(--audioguide-side-width) - 6px);
    }

    .audioguide-workspace > .audioguide-side-column{
        flex: 0 0 var(--audioguide-side-width);
        width: var(--audioguide-side-width);
        max-width: var(--audioguide-side-width);
        min-width: 280px;
    }

    .audioguide-workspace > .audioguide-panel-resizer{
        flex: 0 0 14px;
        width: 14px;
        position: relative;
        align-items: center;
        justify-content: center;
        cursor: col-resize;
        background: transparent;
        border-left: 1px solid #e8ecf2;
        border-right: 1px solid #e8ecf2;
        transition: background 0.15s ease;
    }

    .audioguide-workspace > .audioguide-panel-resizer:hover,
    .audioguide-workspace.is-resizing > .audioguide-panel-resizer{
        background: #eef2ff;
    }

    .audioguide-workspace > .audioguide-panel-resizer::before{
        content: "";
        position: absolute;
        top: 1rem;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 4px;
        border-radius: 999px;
        background: linear-gradient(180deg, #d8e0ee 0%, #c6d1e4 100%);
        opacity: 0.85;
        transition: background 0.18s ease, opacity 0.18s ease;
    }

    .audioguide-workspace > .audioguide-panel-resizer:hover::before,
    .audioguide-workspace.is-resizing > .audioguide-panel-resizer::before{
        background: linear-gradient(180deg, #7fa2ff 0%, #3f6de6 100%);
        opacity: 1;
    }

    .audioguide-workspace.is-collapsed > .audioguide-panel-resizer{
        display: none !important;
    }

    .audioguide-workspace.is-collapsed > .audioguide-side-column{
        display: none !important;
    }

    .audioguide-workspace.is-collapsed > .audioguide-main-column{
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .audioguide-toolbar-side{
        margin-left: auto;
    }
}

@media (max-width: 767.98px) {
    .audioguide-panel-resizer,
    .audioguide-sidenav-toggle-btn{
        display: none !important;
    }
}

/* Habillage panel — compact header buttons */
.hab-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #d8e2f1;
    background: #f4f7fc;
    color: var(--mv-gray-600);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.hab-btn--text{
    width: auto;
    min-width: 30px;
    padding: 0 10px;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
}

.hab-btn--text span{
    line-height: 1;
}

.hab-btn:hover{
    background: #eaf0f9;
    border-color: #bfd0e8;
    color: #111827;
    box-shadow: none;
}
.hab-btn--create{
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    border-color: transparent;
    color: #fff;
}
.hab-btn--create:hover{
    background: linear-gradient(135deg, #0284c7, #0891b2);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px rgba(6,182,212,0.22);
}
.hab-btn--library{
    background: linear-gradient(135deg, #3b82f6, var(--mv-primary));
    border-color: transparent;
    color: #fff;
}
.hab-btn--library:hover{
    background: linear-gradient(135deg, var(--mv-primary), var(--mv-primary-hover));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 85, 255,0.22);
}
.hab-btn svg{
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.audioguide-side-card{
    border: 1px solid #e4eaf4;
    border-radius: 16px;
    box-shadow: none !important;
}

.audioguide-side-card-header{
    background: linear-gradient(to bottom, #f8fbff, #ffffff);
}

.audioguide-sidenav-card .card-body{
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.audioguide-sidenav-block{
    border: 1px solid #e6ecf5;
    border-radius: 12px;
    background: #fbfdff;
    padding: 8px;
}

.audioguide-sidenav-block-title{
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mv-gray-600);
    margin-bottom: 2px;
}

.audioguide-sidenav-section-head{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.audioguide-hab-actions-slot{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.audioguide-hab-actions-slot .audioguide-side-header-actions{
    margin-left: auto;
}

/* Bloc Expressions (Tonalite, Bruitage, Pause) : son contenu suit la voix de
   la sequence active (attributs poses par static/js/audioguide_exp_tags.js).
   Puces neutres, la couleur n'apparait qu'au survol pour garder le panneau calme. */
.audioguide-exp-toolbar{
    margin-top: 4px;
}

.audioguide-exp-section{
    padding: 10px 0;
}
.audioguide-exp-section:first-child{
    padding-top: 2px;
}
.audioguide-exp-section + .audioguide-exp-section{
    border-top: 1px solid #edf1f7;
}

.audioguide-exp-toolbar-label{
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--mv-gray-500);
}

.audioguide-exp-chip-row{
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.audioguide-exp-chip-row:empty{
    display: none;
}

.exp-chip{
    display: inline-flex;
    align-items: center;
    height: 24px;
    margin: 0;
    padding: 0 9px;
    border: 1px solid #e3e8f0;
    border-radius: 999px;
    background: #fff;
    color: var(--mv-gray-700, #374151);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.exp-chip:hover,
.exp-chip:focus-visible{
    border-color: var(--mv-primary, #0055ff);
    background: var(--mv-primary-50, #eef4ff);
    color: var(--mv-primary, #0055ff);
    outline: none;
}
.exp-chip--pause{
    border-style: dashed;
    background: transparent;
    color: var(--mv-gray-600, #4b5563);
}

.audioguide-exp-toolbar[data-exp-has-tones="false"] [data-exp-section="tone"],
.audioguide-exp-toolbar[data-exp-has-sounds="false"] [data-exp-section="sound"],
.audioguide-exp-toolbar[data-exp-free-directives="false"] [data-exp-custom]{
    display: none;
}

/* Saisie sur mesure : champ compact avec bouton « + » integre. */
.audioguide-exp-custom{
    position: relative;
    margin-top: 8px;
}
.audioguide-exp-custom .form-control{
    height: 28px;
    padding: 0 32px 0 10px;
    border-color: #e3e8f0;
    border-radius: 999px;
    font-size: 0.72rem;
}
.audioguide-exp-custom .form-control::placeholder{
    color: var(--mv-gray-400, #9ca3af);
}
.audioguide-exp-custom-submit{
    position: absolute;
    top: 3px;
    right: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--mv-primary, #0055ff);
    color: #fff;
}
.audioguide-exp-custom-submit:disabled{
    opacity: 0.5;
}
.audioguide-exp-custom-submit svg{
    width: 12px;
    height: 12px;
}

/* Script vide : invite a ecrire. */
.exp-editable-text:empty::before,
.exp-editable-text:has(> br:only-child)::before{
    content: attr(data-placeholder);
    color: var(--mv-gray-400, #9ca3af);
    pointer-events: none;
}

/* Rien a generer ni a enrichir tant que le script est vide. */
.hector-exp-sequence:has(.exp-editable-text:empty) :is(.exp-generer-btn, .exp-suggest-tags-btn),
.hector-exp-sequence:has(.exp-editable-text > br:only-child) :is(.exp-generer-btn, .exp-suggest-tags-btn){
    display: none !important;
}

/* Separateur d'insertion : un filet invisible au repos, un « + » au survol
   ou au focus, qui propose une pause ou un effet sonore. */
.audioguide-pause-inserter{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Le separateur reserve la hauteur de ses boutons (26px) : rien ne
       deborde sur les blocs voisins. La sequence du dessus a deja 10px de
       marge basse, d'ou la marge haute negative. */
    height: 26px;
    margin: -6px 0 6px;
    z-index: 2;
}
.audioguide-pause-inserter::before{
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    top: 50%;
    border-top: 1px dashed transparent;
    transition: border-color 0.15s ease;
}
.audioguide-pause-inserter-btn{
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #d8e2f1;
    border-radius: 999px;
    background: #fff;
    color: var(--mv-gray-600, #4b5563);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.audioguide-pause-inserter:hover::before,
.audioguide-pause-inserter:focus-within::before,
.audioguide-pause-inserter.is-open::before{
    border-top-color: #d8e2f1;
}
.audioguide-pause-inserter:hover .audioguide-pause-inserter-btn,
.audioguide-pause-inserter-btn:focus-visible,
.audioguide-pause-inserter.is-open .audioguide-pause-inserter-btn{
    opacity: 1;
    transform: scale(1);
}
.audioguide-pause-inserter-btn:hover,
.audioguide-pause-inserter.is-open .audioguide-pause-inserter-btn{
    border-color: var(--mv-primary, #0055ff);
    color: var(--mv-primary, #0055ff);
}
/* Apres le dernier bloc, le « + » reste visible : c'est le point d'ajout naturel. */
.audioguide-pause-inserter.is-last{
    margin-top: -2px;
    margin-bottom: 0;
}
.audioguide-pause-inserter.is-last .audioguide-pause-inserter-btn{
    opacity: 0.75;
    transform: scale(1);
}
@media (hover: none){
    /* Ecran tactile : pas de survol, la pastille reste discretement visible. */
    .audioguide-pause-inserter-btn{ opacity: 0.6; transform: scale(1); }
}

/* Colonne assez large : boutons directs au lieu du « + » et de son menu. */
#hectorExpSequencesSection{
    container-type: inline-size;
}
.audioguide-inserter-inline{
    position: relative;
    display: none;
    gap: 6px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.audioguide-inserter-inline button{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 9px;
    border: 1px solid #d8e2f1;
    border-radius: 999px;
    background: #fff;
    color: var(--mv-gray-600, #4b5563);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.audioguide-inserter-inline button:hover,
.audioguide-inserter-inline button:focus-visible{
    border-color: var(--mv-primary, #0055ff);
    color: var(--mv-primary, #0055ff);
    outline: none;
}
.audioguide-pause-inserter:hover .audioguide-inserter-inline,
.audioguide-pause-inserter:focus-within .audioguide-inserter-inline,
.audioguide-pause-inserter.is-last .audioguide-inserter-inline{
    opacity: 1;
    transform: scale(1);
}
.audioguide-pause-inserter.is-last .audioguide-inserter-inline button{
    opacity: 0.8;
}
.audioguide-pause-inserter.is-last .audioguide-inserter-inline button:hover{
    opacity: 1;
}
@media (hover: none){
    .audioguide-inserter-inline{ opacity: 0.7; transform: scale(1); }
}
@container (max-width: 299px){
    /* Colonne tres etroite : le nom de l'effet garde sa ligne. */
    .audioguide-sequence .ag-sfx-row{ flex-wrap: wrap; }
    .audioguide-sequence .ag-sfx-row .ag-sfx-label{ flex-basis: calc(100% - 32px); }
    .audioguide-sequence .ag-sfx-row .ag-sfx-volume input[type="range"]{ width: 52px; }
    .audioguide-sequence .ag-amb-strip .ag-sfx-label{ max-width: 90px; }
    .audioguide-sequence .ag-amb-strip .ag-sfx-volume input[type="range"]{ width: 52px; }
}
@container (max-width: 360px){
    .ag-sfx-compose-row{ flex-wrap: wrap; }
    .ag-sfx-compose-row .ag-sfx-generate{ width: 100%; }
}
@container (max-width: 380px){
    .ag-sfx-field .ag-sfx-suggest span{ display: none; }
}
@container (min-width: 300px){
    .audioguide-inserter-inline{ display: inline-flex; }
    .audioguide-pause-inserter-btn,
    .audioguide-inserter-menu{ display: none; }
}
.audioguide-inserter-menu{
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    padding: 4px;
    border: 1px solid #e3e9f3;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.audioguide-inserter-menu button{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    text-align: left;
    color: var(--mv-gray-700, #374151);
    font-size: 0.8rem;
}
.audioguide-inserter-menu button small{
    color: var(--mv-gray-500, #6b7280);
    font-size: 0.7rem;
}
.audioguide-inserter-menu button:hover,
.audioguide-inserter-menu button:focus-visible{
    background: var(--mv-primary-50, #eef4ff);
    outline: none;
}

/* ---------------------------------------------------------------
   Effet sonore entre deux sequences (bloc BRU) et ambiance
   --------------------------------------------------------------- */
.audioguide-sequence.sfx-insert{
    border-left-style: dotted;
    border-left-color: #7c8db5;
    background: #f7f9fc;
    padding-top: 6px;
    padding-bottom: 6px;
}
/* Pendant la creation, seul le composeur est encadre. */
.audioguide-sequence.sfx-insert.is-composing{
    padding: 0;
    border-left-color: transparent;
    background: transparent;
    box-shadow: none;
}
.audioguide-sequence.sfx-insert.is-composing .ag-sfx-composer{ margin-top: 0; }
.ag-sfx-row,
.ag-amb-strip{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
    font-size: 0.8rem;
    color: var(--mv-gray-700, #374151);
}
.ag-sfx-badge{
    display: inline-flex;
    color: #5b6b8f;
}
.ag-sfx-row{ flex-wrap: nowrap; }
.ag-sfx-label{
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ag-sfx-meta{
    color: var(--mv-gray-500, #6b7280);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ag-sfx-icon-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--mv-gray-600, #4b5563);
}
.ag-sfx-icon-btn:hover,
.ag-sfx-icon-btn:focus-visible{
    border-color: #d8e2f1;
    background: #fff;
    color: var(--mv-primary, #0055ff);
    outline: none;
}
/* Boutons communs aux effets sonores et ambiances : meme hauteur, meme
   pastille, trois variantes (neutre, principal, discret). */
.ag-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid #d8e2f1;
    border-radius: 999px;
    background: #fff;
    color: var(--mv-gray-700, #374151);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.ag-btn:hover,
.ag-btn:focus-visible{
    border-color: var(--mv-primary, #0055ff);
    color: var(--mv-primary, #0055ff);
    outline: none;
}
.ag-btn:focus-visible{ box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.15); }
.ag-btn:disabled{ opacity: 0.55; cursor: not-allowed; }
.ag-btn--sm{
    height: 28px;
    padding: 0 11px;
    font-size: 0.74rem;
}
.ag-btn--primary{
    border-color: var(--mv-primary, #0055ff);
    background: var(--mv-primary, #0055ff);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 85, 255, 0.22);
}
.ag-btn--primary:hover,
.ag-btn--primary:focus-visible{
    background: var(--mv-primary-hover, #0046d4);
    color: #fff;
}
.ag-btn--ghost{
    border-color: transparent;
    background: transparent;
    color: var(--mv-gray-600, #4b5563);
}
.ag-btn--ghost:hover,
.ag-btn--ghost:focus-visible{
    border-color: transparent;
    background: var(--mv-primary-50, #eef4ff);
}
.ag-sfx-volume{
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ag-sfx-volume input[type="range"]{
    --ag-fill: 50%;
    width: 96px;
    height: 4px;
    border-radius: 999px;
    appearance: none;
    background: linear-gradient(to right, var(--mv-primary, #0055ff) var(--ag-fill), #dde4ef var(--ag-fill));
    cursor: pointer;
}
.ag-sfx-volume input[type="range"]::-webkit-slider-thumb{
    appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--mv-primary, #0055ff);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
}
.ag-sfx-volume input[type="range"]::-moz-range-thumb{
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--mv-primary, #0055ff);
}
.ag-sfx-volume output{
    min-width: 34px;
    color: var(--mv-gray-500, #6b7280);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

/* Menu ⋯ */
.ag-sfx-menu-wrap{
    position: relative;
    display: inline-flex;
}
.ag-sfx-menu{
    /* Place en JS (placeMenu) sous <body> : jamais rogne par une carte. */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1060;
    min-width: 230px;
    max-width: calc(100vw - 16px);
    padding: 4px;
    border: 1px solid #e3e9f3;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.ag-sfx-menu > button{
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    text-align: left;
    font-size: 0.8rem;
    color: var(--mv-gray-700, #374151);
}
.ag-sfx-menu > button:hover,
.ag-sfx-menu > button:focus-visible{
    background: var(--mv-primary-50, #eef4ff);
    outline: none;
}
.ag-sfx-menu > button.is-danger{ color: #c0392b; }
.ag-sfx-menu-check,
.ag-sfx-menu-fades{
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 10px;
    border-top: 1px solid #eef2f7;
    font-size: 0.75rem;
    color: var(--mv-gray-600, #4b5563);
}
.ag-sfx-menu-fades{ flex-wrap: wrap; }
.ag-sfx-menu-fades span{ width: 100%; font-weight: 600; }
.ag-sfx-menu-fades label,
.ag-sfx-menu-check{ font-weight: 400; }
.ag-sfx-menu-fades input{
    width: 52px;
    padding: 1px 4px;
    border: 1px solid #d8e2f1;
    border-radius: 5px;
}

/* Ambiance d'une sequence : une ligne discrete sous le texte, sans cadre ni
   fond, qui ne prend que la largeur de son contenu. */
.ag-amb-strip{
    display: flex;
    flex-wrap: nowrap;
    gap: var(--mv-space-1, 4px);
    width: fit-content;
    max-width: 100%;
    min-height: 28px;
    margin-top: var(--mv-space-1, 4px);
    padding: 0 0 0 var(--mv-space-1, 4px);
    font-size: var(--mv-fs-xs);
    color: var(--mv-text);
}
.ag-amb-strip .ag-sfx-badge{ color: var(--mv-text-muted); }
.ag-amb-strip .ag-sfx-label{
    flex: 0 1 auto;
    max-width: 260px;
    font-weight: 500;
}
.ag-amb-strip .ag-sfx-icon-btn{
    width: 24px;
    height: 24px;
    color: var(--mv-text-muted);
}
.ag-amb-strip .ag-sfx-icon-btn:hover,
.ag-amb-strip .ag-sfx-icon-btn:focus-visible{ color: var(--mv-primary); }
.ag-amb-strip .ag-sfx-volume input[type="range"]{ width: 72px; }
.ag-amb-strip .ag-sfx-volume output{ min-width: 28px; font-size: var(--mv-fs-2xs); }
.ag-amb-hector{
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--mv-primary, #0055ff);
    font-size: 0.65rem;
    font-style: normal;
    font-weight: 600;
}
/* Placement de l'ambiance dans le menu ⋯ : la voix au centre, l'ambiance
   au-dessus, deux poignees a glisser. Positions et fondus poses en JS. */
.ag-amb-panel{
    width: 320px;
    max-width: 100%;
    padding: var(--mv-space-2) var(--mv-space-3) var(--mv-space-3);
}
.ag-amb-panel-head{
    display: flex;
    align-items: center;
    gap: var(--mv-space-2);
    margin-bottom: var(--mv-space-3);
}
.ag-amb-panel-title{
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--mv-text-strong);
    font-size: var(--mv-fs-xs);
    font-weight: var(--mv-fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ag-amb-panel-actions{
    display: inline-flex;
    flex: 0 0 auto;
    gap: 2px;
}
.ag-amb-panel-actions .ag-sfx-icon-btn{
    width: 28px;
    height: 28px;
    color: var(--mv-text-muted);
}
.ag-amb-panel-actions .ag-sfx-icon-btn:hover,
.ag-amb-panel-actions .ag-sfx-icon-btn:focus-visible{ color: var(--mv-primary); }
.ag-amb-panel-actions .ag-sfx-icon-btn.is-danger:hover,
.ag-amb-panel-actions .ag-sfx-icon-btn.is-danger:focus-visible{ color: var(--mv-danger); }
.ag-amb-place{ width: 100%; }
.ag-amb-fades{
    display: flex;
    justify-content: space-between;
    margin-top: var(--mv-space-2);
}
.ag-amb-fades label{
    display: inline-flex;
    align-items: center;
    gap: var(--mv-space-1);
    margin: 0;
    color: var(--mv-text-muted);
    font-size: var(--mv-fs-2xs);
    font-weight: var(--mv-fw-regular);
}
.ag-amb-fades input{
    width: 44px;
    padding: 1px var(--mv-space-1);
    border: 1px solid var(--mv-border);
    border-radius: var(--mv-radius-xs);
    color: var(--mv-text);
    font-size: var(--mv-fs-2xs);
}
.ag-amb-track{
    position: relative;
    height: 50px;
    touch-action: none;
    user-select: none;
}
.ag-amb-zone{
    position: absolute;
    bottom: 0;
    width: 22%;
    height: 22px;
    overflow: hidden;
    border-radius: var(--mv-radius-xs);
    background: var(--mv-surface-muted);
    color: var(--mv-text-muted);
    font-size: var(--mv-fs-2xs);
    line-height: 22px;
    text-align: center;
    white-space: nowrap;
}
.ag-amb-zone.is-before{ left: 0; }
.ag-amb-zone.is-after{ right: 0; }
.ag-amb-zone.is-edge{
    background: transparent;
    color: var(--mv-text-disabled);
}
.ag-amb-voice{
    position: absolute;
    bottom: 0;
    left: 22%;
    width: 56%;
    height: 22px;
    overflow: hidden;
    border-radius: var(--mv-radius-xs);
    background: var(--mv-gray-200);
    color: var(--mv-text);
    font-size: var(--mv-fs-2xs);
    line-height: 22px;
    text-align: center;
    white-space: nowrap;
}
/* Forme d'onde dessinee en JS, couleur lue sur `color`. */
.ag-amb-voice canvas{
    position: absolute;
    inset: 2px 3px;
    width: calc(100% - 6px);
    height: calc(100% - 4px);
    color: var(--mv-gray-500);
}
.ag-amb-voice.has-wave{ background: var(--mv-gray-100); }
.ag-amb-voice span{ position: relative; }
.ag-amb-bar{
    --ag-amb-fade-in: 0%;
    --ag-amb-fade-out: 0%;
    position: absolute;
    top: 4px;
    height: 18px;
    border-radius: var(--mv-radius-sm);
    background: linear-gradient(to right,
        var(--mv-primary-100) 0,
        var(--mv-primary-300) var(--ag-amb-fade-in),
        var(--mv-primary-300) calc(100% - var(--ag-amb-fade-out)),
        var(--mv-primary-100) 100%);
    transition: left var(--mv-transition-fast), width var(--mv-transition-fast);
}
.ag-amb-place.is-dragging .ag-amb-bar{ transition: none; }
.ag-amb-bar.is-extended{ border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ag-amb-handle{
    position: absolute;
    top: -3px;
    width: 10px;
    height: 24px;
    border: 2px solid var(--mv-primary);
    border-radius: var(--mv-radius-pill);
    background: var(--mv-white);
    box-shadow: var(--mv-shadow-sm);
    cursor: ew-resize;
}
.ag-amb-handle.is-start{ left: -5px; }
.ag-amb-handle.is-end{ right: -5px; }
.ag-amb-handle:focus-visible{
    outline: none;
    box-shadow: 0 0 0 3px var(--mv-primary-focus-ring);
}
.ag-amb-place-text{
    min-height: 2.6em;
    margin: var(--mv-space-2) 0 0;
    color: var(--mv-text-muted);
    font-size: var(--mv-fs-2xs);
    line-height: var(--mv-lh-normal);
}

/* Note du menu ⋯ (fond global attenue). */
.ag-amb-note{
    margin: var(--mv-space-2) 0 0;
    padding: var(--mv-space-2) 0 0;
    border-top: 1px solid var(--mv-divider);
    color: var(--mv-text-muted);
    font-size: var(--mv-fs-2xs);
}
.ag-amb-trigger{
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ag-amb-trigger.is-set{
    border-color: rgba(13, 148, 136, 0.35);
    background: rgba(13, 148, 136, 0.08);
    color: #0d9488;
}

/* Composeur en ligne : Creer | Bibliotheque | Importer */
.ag-sfx-composer{
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #e3e9f3;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
    animation: ag-sfx-in 0.16s ease-out;
}
@keyframes ag-sfx-in{ from { opacity: 0; transform: translateY(-3px); } }
.ag-sfx-composer-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.ag-sfx-tabs{
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: #f1f4f9;
}
.ag-sfx-tabs button{
    height: 26px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--mv-gray-600, #4b5563);
    font-size: 0.75rem;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.ag-sfx-tabs button:hover{ color: var(--mv-gray-800, #1f2937); }
.ag-sfx-tabs button[aria-selected="true"]{
    background: #fff;
    color: var(--mv-primary, #0055ff);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
/* Ligne de creation : champ (micro + « Suggérer » integres) puis « Créer ». */
.ag-sfx-compose-row{
    display: flex;
    align-items: center;
    gap: 8px;
}
.ag-sfx-field{
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 2px;
    min-width: 0;
    height: 40px;
    padding: 0 4px 0 0;
    border: 1px solid #d8e2f1;
    border-radius: 999px;
    background: #fbfcfe;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.ag-sfx-field:focus-within{
    border-color: var(--mv-primary, #0055ff);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.1);
}
.ag-sfx-prompt{
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0 6px 0 16px;
    border: 0;
    background: transparent;
    font-size: 0.85rem;
}
.ag-sfx-prompt:focus{ outline: none; }
.ag-sfx-prompt::placeholder{ color: var(--mv-gray-400, #9ca3af); }
.ag-sfx-field .mvi-btn{ flex: 0 0 auto; }
.ag-btn--lg{
    height: 40px;
    padding: 0 20px;
    font-size: 0.82rem;
}
.ag-sfx-generate{ flex: 0 0 auto; min-width: 96px; }
.ag-sfx-actions{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding-left: 4px;
    font-size: 0.75rem;
    color: var(--mv-gray-600, #4b5563);
}
/* Interrupteur « Durée auto ». */
.ag-sfx-switch{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}
.ag-sfx-switch input{
    position: relative;
    width: 30px;
    height: 18px;
    margin: 0;
    border-radius: 999px;
    background: #d8e2f1;
    appearance: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.ag-sfx-switch input::after{
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
    transition: transform 0.15s ease;
}
.ag-sfx-switch input:checked{ background: var(--mv-primary, #0055ff); }
.ag-sfx-switch input:checked::after{ transform: translateX(12px); }
.ag-sfx-switch input:focus-visible{ outline: 2px solid rgba(0, 85, 255, 0.35); outline-offset: 2px; }
.ag-sfx-duration{
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ag-sfx-duration[hidden]{ display: none; }
.ag-sfx-duration output{ min-width: 30px; font-variant-numeric: tabular-nums; }
/* Bibliotheque */
.ag-sfx-search{
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border: 1px solid #d8e2f1;
    border-radius: 999px;
    background: #fbfcfe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center;
    font-size: 0.8rem;
}
.ag-sfx-search:focus{
    border-color: var(--mv-primary, #0055ff);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.1);
    outline: none;
}
.ag-sfx-results{
    max-height: 240px;
    margin-top: 8px;
    overflow-y: auto;
}
.ag-sfx-result{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
    transition: background-color 0.12s ease;
}
.ag-sfx-result:hover{ background: #f5f7fb; }
.ag-sfx-result-name{
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ag-sfx-result-name em{
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.1);
    color: #0d9488;
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 600;
}
.ag-sfx-result-meta{
    color: var(--mv-gray-500, #6b7280);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}
.ag-sfx-empty{
    padding: 14px 6px;
    color: var(--mv-gray-500, #6b7280);
    font-size: 0.78rem;
    text-align: center;
}
/* Import */
.ag-sfx-drop{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 84px;
    margin: 0;
    padding: 12px;
    border: 1.5px dashed #c9d5e8;
    border-radius: 12px;
    background: #fbfcfe;
    color: var(--mv-gray-700, #374151);
    font-size: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ag-sfx-drop:hover,
.ag-sfx-drop:focus-within{
    border-color: var(--mv-primary, #0055ff);
    background: var(--mv-primary-50, #eef4ff);
}
.ag-sfx-drop input{
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.ag-sfx-drop strong{ display: block; color: var(--mv-primary, #0055ff); }
.ag-sfx-drop small{
    display: block;
    margin-top: 2px;
    color: var(--mv-gray-500, #6b7280);
}
.ag-sfx-status{
    margin-top: 8px;
    color: var(--mv-gray-600, #4b5563);
    font-size: 0.75rem;
}
.ag-sfx-status:empty{ display: none; }
.ag-sfx-status.is-error{ color: #c0392b; }
.ag-sfx-composer.is-busy .ag-sfx-status::before{
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border: 2px solid #c9d5e8;
    border-top-color: var(--mv-primary, #0055ff);
    border-radius: 50%;
    vertical-align: -1px;
    animation: ag-sfx-spin 0.8s linear infinite;
}
@keyframes ag-sfx-spin{ to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce){
    .ag-sfx-composer,
    .ag-sfx-composer.is-busy .ag-sfx-status::before{ animation: none; }
}
@media (max-width: 576px){
    .ag-sfx-volume input[type="range"]{ width: 72px; }
}

/* Compilation en fin de script. */
.audioguide-compile-footer{
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Une voix de lecture ne sait pas enrichir le texte. */
.hector-exp-sequence[data-expressivity="reading"] .exp-suggest-tags-btn{
    display: none !important;
}

.exp-voice-warning{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 6px 0 2px;
    padding: 6px 10px;
    border: 1px solid #f5d9a8;
    border-radius: 8px;
    background: #fff8eb;
    color: #8a5a00;
    font-size: 0.75rem;
}
.exp-voice-warning.d-none{
    display: none;
}
.exp-voice-warning .btn{
    margin: 0;
}

.audioguide-side-title{
    min-width: 0;
}

.audioguide-side-title-text{
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mv-gray-600);
    white-space: nowrap;
}

.audioguide-apply-btn{
    border-radius: 999px;
    min-height: 32px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.audioguide-apply-btn.btn-outline-primary{
    background: #f3f7ff;
    border-color: #bfd2ff;
    color: var(--mv-primary-hover);
}

.audioguide-apply-btn.btn-outline-primary:hover{
    background: #e8f0ff;
    border-color: #93b3ff;
    color: #1e40af;
}

.audioguide-pause-delete-btn{
    width: 100px;
}

.audioguide-exp-toolbar-sticky{
    top: 70px;
    z-index: 100;
}

@media (max-width: 767.98px) {
    .audioguide-toolbar{
        padding: 6px 7px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .audioguide-toolbar-group-label{
        display: none;
    }

    .audioguide-toolbar-player{
        flex: 1 1 100%;
        min-width: 0;
        order: 5;
    }

    .audioguide-toolbar-side{
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    .hab-btn--text span{
        display: none;
    }
}

@media (max-width: 1399.98px) {
    .audioguide-toolbar{
        flex-wrap: wrap;
    }

    .audioguide-toolbar-group-label{
        display: none;
    }

    .audioguide-toolbar-player{
        order: 4;
        flex: 1 1 100%;
    }

    .audioguide-toolbar-side{
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    .hab-btn--text{
        width: 30px;
        padding: 0;
    }

    .hab-btn--text span{
        display: none;
    }
}

/* Habillage card header sticky */
.audioguide-side-column .card-header{
    position: relative;
    top: auto;
    z-index: 1;
}

.audioguide-sequence{
    padding : 0 0 0 10px;
    border-left : 2px solid var(--mv-primary-dark);
    margin-bottom : 10px;
}

.audioguide-sequence.outdated{
    border-left-color: orange;
}

.audioguide-sequence.pause {
    border-left-style: dashed;
    border-left-color: grey;
  }

/* =============================================
   PRONUNCIATION MARKS - Audioguide Editor
   ============================================= */

/* Base style for marked pronunciation text */
.pronunciation-marked {
    position: relative;
    border-bottom: 2px dashed #6c5ce7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pronunciation-marked:hover {
    background-color: rgba(108, 92, 231, 0.15);
    border-bottom-color: #5647d0;
}

/* Tooltip showing pronunciation on hover */
.pronunciation-marked::after {
    content: attr(data-pronunciation);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3436;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

/* Arrow for tooltip */
.pronunciation-marked::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2d3436;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.pronunciation-marked:hover::after,
.pronunciation-marked:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Dictionary entries have a different color */
.pronunciation-marked[data-dictionary="true"] {
    border-bottom-color: #00b894;
}

.pronunciation-marked[data-dictionary="true"]:hover {
    background-color: rgba(0, 184, 148, 0.15);
    border-bottom-color: #00a382;
}

.pronunciation-marked[data-dictionary="true"]::after {
    background-color: #00b894;
}

.pronunciation-marked[data-dictionary="true"]::before {
    border-top-color: #00b894;
}

/* Global dictionary entries (apply to all) - RED style */
.pronunciation-global {
    position: relative;
    border-bottom: 2px dashed #e74c3c;
    cursor: help;
    transition: all 0.2s ease;
}

.pronunciation-global:hover {
    background-color: rgba(231, 76, 60, 0.15);
    border-bottom-color: #c0392b;
}

/* Tooltip showing pronunciation on hover */
.pronunciation-global::after {
    content: attr(data-pronunciation);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #e74c3c;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

/* Arrow for tooltip */
.pronunciation-global::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #e74c3c;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.pronunciation-global:hover::after,
.pronunciation-global:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Pronunciation modal styles */
#pronunciationModal .pronunciation-preview-section {
    background-color: var(--mv-gray-50);
    border-radius: 8px;
    padding: 15px;
}

#pronunciationModal .pronunciation-preview-section .btn-preview {
    min-width: 120px;
}

#pronunciationModal .pronunciation-original-text {
    background-color: #fff;
    border: 1px solid var(--mv-gray-200);
    border-radius: 4px;
    padding: 10px 15px;
    font-weight: 500;
    margin-bottom: 15px;
}

/* Context menu for pronunciation selection */
.pronunciation-context-menu {
    position: fixed !important;
    z-index: 1100 !important;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    padding: 5px 0;
    min-width: 200px;
    display: none;
}

.pronunciation-context-menu.show {
    display: block !important;
}

.pronunciation-context-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--mv-text-heading);
    transition: background-color 0.15s ease;
}

.pronunciation-context-menu button:hover {
    background-color: #f0f7ff;
}

.pronunciation-context-menu button i {
    margin-right: 10px;
    color: var(--mv-primary);
}

/* Pronunciation marker in text */
.pronunciation-marker {
    background-color: rgba(0, 85, 255, 0.15);
    border-bottom: 2px dashed var(--mv-primary);
    padding: 0 2px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s ease;
}

.pronunciation-marker:hover {
    background-color: rgba(0, 85, 255, 0.3);
}

.pronunciation-marker::after {
    content: attr(data-pronunciation);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--mv-text-heading);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
}

.pronunciation-marker:hover::after {
    opacity: 1;
    visibility: visible;
}

.aud-desc-prep-dialog {
  max-width: min(1760px, calc(100vw - 24px));
}

.aud-desc-header-card {
  border: 1px solid #dce5f7;
  border-radius: 14px;
  padding: 13px 14px;
  background: linear-gradient(180deg, #f7faff 0%, #fdfdff 100%);
  box-shadow: 0 4px 14px rgba(31, 66, 145, 0.06);
}

.aud-desc-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aud-desc-step-card {
  border: 1px solid #e3e9f5;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 7px 20px rgba(24, 46, 91, 0.05);
  overflow: hidden;
}

.aud-desc-step-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.aud-desc-step-meta {
  min-width: 0;
}

.aud-desc-step-meta h6 {
  font-size: 1rem;
}

.aud-desc-step-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.aud-desc-source-preview,
.aud-desc-source-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.aud-desc-source-full {
  margin-top: 6px;
}

.aud-desc-source-toggle {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.aud-desc-source-toggle .btn-link {
  font-size: 0.8rem;
  text-decoration: none;
}

.aud-desc-source-text {
  border: 1px solid #e7ecf6;
  border-radius: 10px;
  background: #fbfcfe;
  padding: 10px 11px;
  font-size: 0.85rem;
  line-height: 1.5;
  max-height: 165px;
  overflow: auto;
  white-space: pre-wrap;
}

.aud-desc-images {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aud-desc-image-card {
  border: 1px solid #e5eaf4;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.aud-desc-image-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.aud-desc-image-workspace {
  width: 100%;
}

.aud-desc-image-workspace.row {
  --bs-gutter-x: 12px;
  --bs-gutter-y: 12px;
  align-items: start;
}

.aud-desc-image-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.aud-desc-image-stage {
  position: relative;
  border-radius: 10px;
  border: 1px solid #e3e8f0;
  background: #f6f8fc;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.aud-desc-image-stage img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: min(80vh, 620px) !important;
  object-fit: contain;
}

.aud-desc-image-stage.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
}

.aud-desc-image-empty {
  color: #8b95a7;
  font-size: 0.84rem;
  padding: 14px;
}

.aud-desc-image-tip {
  font-size: 0.77rem;
  color: #69758c;
}

.aud-desc-markers-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.aud-desc-scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 85, 255, 0.04) 0%,
    rgba(0, 85, 255, 0.1) 52%,
    rgba(0, 85, 255, 0.04) 100%
  );
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.aud-desc-scan-overlay.is-active {
  opacity: 1;
}

.aud-desc-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  top: -10%;
  background: linear-gradient(90deg, rgba(0, 85, 255, 0), rgba(0, 85, 255, 0.95), rgba(0, 85, 255, 0));
  box-shadow: 0 0 12px rgba(0, 85, 255, 0.45);
  animation: aud-desc-scan-sweep 1.7s linear infinite;
}

@keyframes aud-desc-scan-sweep {
  0% {
    top: -10%;
  }
  100% {
    top: 110%;
  }
}

.aud-desc-marker-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0, 85, 255, 0.85);
  border-radius: 999px;
  background: rgba(0, 85, 255, 0.9);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.aud-desc-image-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #e7ecf6;
  border-radius: 12px;
  background: #f9fbff;
  padding: 11px;
  min-width: 0;
}

.aud-desc-scan-badge {
  border: 1px solid transparent;
}

.aud-desc-scan-badge.is-idle {
  background: var(--mv-gray-50);
  border-color: #d8e0ec;
  color: #5f6b7d;
}

.aud-desc-scan-badge.is-queued,
.aud-desc-scan-badge.is-scanning {
  background: #eef4ff;
  border-color: #bfd2ff;
  color: #1e429f;
}

.aud-desc-scan-badge.is-done {
  background: #ecfdf3;
  border-color: #b7ebc6;
  color: #166534;
}

.aud-desc-scan-badge.is-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.aud-desc-scan-badge.is-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.aud-desc-analysis-card {
  border: 1px solid #e6ebf7;
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
}

.aud-desc-analysis-text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--mv-gray-700);
  max-height: 134px;
  overflow: auto;
  white-space: pre-wrap;
}

.aud-desc-analysis-text.is-muted {
  color: var(--mv-gray-500);
}

.aud-desc-analysis-text.is-warning {
  color: #92400e;
}

.aud-desc-analysis-text.is-error {
  color: #991b1b;
}

.aud-desc-helper-card {
  border: 1px solid #e6ebf7;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.aud-desc-helper-title {
  font-size: 0.8rem;
  color: #1f2f52;
  font-weight: 600;
}

.aud-desc-helper-list {
  margin: 0;
  padding-left: 17px;
}

.aud-desc-helper-list li {
  font-size: 0.76rem;
  color: #4c5a75;
  margin-bottom: 4px;
}

.aud-desc-helper-list li:last-child {
  margin-bottom: 0;
}

.aud-desc-markers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aud-desc-markers-empty {
  border: 1px dashed #d2dbeb;
  border-radius: 8px;
  background: #fff;
  color: #68738a;
  font-size: 0.8rem;
  padding: 8px 10px;
}

.aud-desc-marker-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.aud-desc-marker-row-index {
  font-size: 0.72rem;
  color: #6d7788;
  min-width: 28px;
}

.aud-desc-marker-remove {
  white-space: nowrap;
}

.aud-desc-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.aud-desc-empty-images {
  border: 1px dashed #d7ddea;
  border-radius: 10px;
  padding: 12px;
  color: #738097;
  font-size: 0.84rem;
  background: #fafbfd;
}

.aud-desc-library-panel {
  border: 1px solid #dfe7f6;
  border-radius: 13px;
  background: #fff;
  padding: 13px;
  margin-bottom: 14px;
  box-shadow: 0 6px 15px rgba(18, 45, 97, 0.05);
}

.aud-desc-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 11px;
}

.aud-desc-library-item {
  border: 1px solid #e6eaf2;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.aud-desc-library-thumb {
  background: #f5f7fb;
  height: 130px;
}

.aud-desc-library-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.aud-desc-library-meta {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aud-desc-library-name {
  font-size: 0.78rem;
  color: #20293a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aud-desc-library-loading,
.aud-desc-library-empty,
.aud-desc-library-error {
  border: 1px dashed #d4dbea;
  border-radius: 8px;
  background: #fafbfd;
  color: var(--mv-gray-500);
  font-size: 0.84rem;
  padding: 10px;
}

.aud-desc-library-error {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.aud-desc-task-alert {
  top: 20px;
  right: 20px;
  width: min(430px, calc(100vw - 30px));
  z-index: 1060;
  box-shadow: 0 14px 32px rgba(19, 35, 69, 0.16);
}

.aud-desc-task-log {
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background: #fff;
}

.aud-desc-task-log-line {
  font-size: 0.78rem;
  color: var(--mv-gray-700);
  padding: 6px 8px;
  border-bottom: 1px solid #eff3fa;
}

.aud-desc-task-log-line:last-child {
  border-bottom: none;
}

@media (max-width: 991.98px) {
  .aud-desc-source-preview,
  .aud-desc-source-grid {
    grid-template-columns: 1fr;
  }

  .aud-desc-step-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .aud-desc-marker-row {
    grid-template-columns: 1fr;
  }

  .aud-desc-marker-row-index {
    min-width: auto;
  }

  .aud-desc-task-alert {
    left: 14px;
    right: 14px;
    width: auto;
  }

  .aud-desc-image-stage img {
    max-height: min(56vh, 440px) !important;
  }
}

/* Audioguide source / modal */
.audioguide-source-badge {
  display: none;
}

.audioguide-sequence .parametre-voix-btn {
  border-radius: 999px;
  border: 1px solid #d8deef;
  background: #f9fbff;
}

.audioguide-sequence .parametre-voix-btn .voix-nom,
.audioguide-sequence .parametre-voix-btn .exp-voice-label {
  font-weight: 600;
}


/* Audioguide sequences visual hierarchy */
.audioguide-sequence {
  position: relative;
  margin-bottom: 14px;
  padding: 10px 12px 12px 14px;
  border-left: 4px solid #2f5ae0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.audioguide-sequence:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.audioguide-sequence .btn-audioguide-sequence {
  margin-bottom: 8px;
}

.audioguide-sequence .editable-text {
  border-radius: 10px;
  background: #f8faff;
  padding: 8px 10px;
}

.audioguide-sequence[data-origin="USR"] {
  border-left-color: #0f9f9b;
  background: #f6fcfb;
}

.audioguide-sequence[data-origin="USR"] .editable-text {
  background: #edf9f8;
}

.audioguide-sequence[data-origin="VCG"] {
  border-left-color: #f08a24;
  background: #fffaf2;
}

.audioguide-sequence[data-origin="VCG"] .editable-text {
  background: #fff4e4;
}

.audioguide-sequence.outdated {
  border-left-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.28), 0 8px 18px rgba(245, 158, 11, 0.12);
}

.audioguide-sequence.pause {
  border-left-style: dashed;
  border-left-color: var(--mv-gray-400);
  background: var(--mv-gray-50);
}

@media (max-width: 768px) {
  .audioguide-sequence {
    padding: 10px 10px 12px 12px;
    margin-bottom: 10px;
  }
}

.agt-voice-expert {
  margin-top: var(--mv-space-4);
  padding-top: var(--mv-space-4);
}

.agt-voice-expert > summary {
  cursor: pointer;
  color: var(--mv-text);
}
