﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/******************************************/

.etapes-scroll {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
}

    .etapes-scroll::-webkit-scrollbar {
        height: 6px;
    }

.etape-block {
    min-width: 220px;
    max-width: 240px;
    flex: 0 0 auto;
    margin-right: 6px;
    text-align: center;
}

.etape-icon {
    width: 48px; /* ↑ taille icône */
    height: 48px;
    font-size: 24px; /* ↑ taille emoji */
    margin-bottom: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 3px rgba(0,0,0,0.1);
}

.step-label {
    font-size: 0.75rem;
    line-height: 1.1;
    white-space: pre-line;
    margin-bottom: 4px;
    font-weight: bold; /* ← mettre en gras */
}

.ring-selected {
    box-shadow: 0 0 0 3px rgba(59,130,246,.35); /* bleu doux */
    border: 2px solid #3b82f6;
}


.panel {
    font-size: 0.8rem; /* ↑ texte dans le panneau */
    line-height: 1.3;
}

/*.panel {
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: left;
    padding: 0.5rem;*/ /* Plus compact */
/*}*/

.step-title {
    font-size: 0.75rem;
    white-space: pre-line;
    word-break: break-word;
    margin-bottom: 4px;
}

.bg-done {
    background-color: #2d6cdf;
}

.bg-missing {
    background-color: #999;
}

.bg-late {
    background-color: #d93025;
}

/* ===== Steps responsive (clean, no JS) ===== */

/* ===== Steps responsive (mixte: orientation + largeur) ===== */

/* ===== Steps responsive (clean, no ::after sur cartes) ===== */
.etapes-scroll-responsive {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
    gap: 1rem;
}

    .etapes-scroll-responsive::-webkit-scrollbar {
        height: 6px;
    }

.etape-block-responsive {
    min-width: 160px;
    max-width: 180px;
    flex: 0 0 auto;
    text-align: center;
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Arrow-step : pas de texte “dur”, uniquement via CSS */
.arrow-step {
    font-size: 0 !important;
    line-height: 0;
}

    .arrow-step::before {
        content: "→"; /* mode paysage par défaut */
        font-size: 1.5rem;
        line-height: 1;
    }

/* Empilé : flèche vers le bas */
@media (orientation: portrait) {
    .etapes-scroll-responsive {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .etape-block-responsive {
        width: 100%;
        max-width: none;
        min-width: 100%;
    }

    .arrow-step::before {
        content: "↓";
    }
}

/* Popup fix en portrait */
@media (orientation: portrait) {
    .etapes-scroll-responsive .report-popup {
        position: static !important;
        width: auto !important;
        max-width: 100% !important;
        left: auto !important;
        top: auto !important;
    }
}


/* Portrait: flèche ↓ centrée */
@media (orientation: portrait) {
    .arrow-step {
        display: block; /* n'est plus un petit inline */
        width: 100%; /* occupe toute la ligne du conteneur flex */
        text-align: center; /* centre le contenu dans la ligne */
        margin: .5rem 0;
        font-size: 0 !important; /* masque le texte dur éventuel */
        line-height: 0;
    }

        .arrow-step::before {
            content: "↓";
            font-size: 1.5rem;
            line-height: 1;
        }
}


/* — Option A : wrap auto au lieu du scroll (décommente si tu préfères)
.etapes-scroll-responsive { flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; }
.etapes-scroll-responsive > .step-clickable,
.etapes-scroll-responsive > .etape-block-responsive { flex: 1 1 18rem; }
*/

/* — Option B : container queries (plus robuste que orientation) —
.etapes-scroll-responsive { container-type: inline-size; }
@container (inline-size < 700px) {
  .etapes-scroll-responsive { flex-direction: column; overflow-y: auto; overflow-x: clip; }
  .etapes-scroll-responsive > .step-clickable,
  .etapes-scroll-responsive > .etape-block-responsive { width: 100%; flex: 0 0 auto; }
}
*/


/*.panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-height: 100px;*/ /* ajuste selon besoin */
/*}*/


.panel {
    font-size: 1rem;
    line-height: 1.5;
}

.timeline-header-cell {
    white-space: nowrap;
    position: relative;
    padding-right: 1.5rem;
}

.timeline-title {
    font-weight: 600;
    display: inline-block;
}

.timeline-arrow {
    margin-left: 0.5rem;
    color: #6c757d;
    font-size: 1.1rem;
}

th.timeline-separator {
    position: relative;
    text-align: center;
    vertical-align: middle;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

    /* Ajoute une flèche → entre les colonnes sauf la dernière */
    th.timeline-separator:not(:last-child)::after {
        content: "→";
        position: absolute;
        top: 50%;
        right: -10px;
        transform: translateY(-50%);
        font-size: 1.2rem;
        font-weight: 900;
        color: #333; /* Flèche foncée */
        pointer-events: none;
    }

.arrow-step {
    color: #444;
    margin-top: 10px; /* ajuste la hauteur de la flèche */
}


.selected-step {
    position: relative;
    box-shadow: 0 0 8px 4px rgba(0, 123, 255, 0.5); /* halo bleu */
    transform: scale(1.20);
    transition: box-shadow 0.2s, transform 0.2s;
    z-index: 2;
}


.etape-icon {
    transition: all 0.2s ease-in-out;
}

.selected-panel {
    background-color: #e6f7ff; /* fond bleu très doux */
    border-left: 5px solid #3399ff;
    padding-left: 1rem;
}

.selected-panel {
    background-color: #e6f7ff !important;
    border-left: 5px solid #3399ff;
}



.etape-icon-wrapper {
    position: relative;
    display: inline-block;
}

.triangle-indicator {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #3399ff;
}

.triangle-indicator-up {
    position: absolute;
    top: 100%;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #cfe2ff; /* ou autre couleur */
    transform: translateX(-50%);
    z-index: 1000;
    transition: left 0.2s ease;
}


.etape-icon {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.status-green {
    color: #198754; /* vert */
}

.status-red {
    color: #dc3545; /* rouge */
}

.status-orange {
    color: #fd7e14; /* orange */
}

.status-gray {
    color: #6c757d; /* gris par défaut */
}


.bg-green {
    background-color: #198754; /* vert Bootstrap classique */
    color: white;
}

.bg-red {
    background-color: #dc3545; /* rouge Bootstrap */
    color: white;
}

.bg-orange {
    background-color: #fd7e14; /* orange vif */
    color: white;
}

.bg-gray {
    background-color: #6c757d; /* gris classique */
    color: white;
}

.etape-icon {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auto-resize-textarea {
    overflow: hidden;
    resize: none;
    min-height: 2.2rem;
    line-height: 1.4;
    height: auto;
}

    /* Astuce CSS : déclenche l'auto-ajustement si texte dépasse */
    .auto-resize-textarea:focus {
        height: auto;
    }


.validation-button {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .validation-button:hover {
        transform: translateY(-3px) scale(1.1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

.bg-white-dot {
    background-color: #e5e7eb; /* Gris un peu plus foncé (Tailwind gray-200) */
    border: 2px solid #6b7280; /* Gris plus marqué (Tailwind gray-500) */
    color: #111;
}

.step-clickable {
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s;
    border-radius: 0.5rem;
}

.step-clickable:hover {
    background-color: rgba(0, 123, 255, 0.05); /* Bleu léger */
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.2);
}

.selected-step-column {
    background-color: rgba(13, 110, 253, 0.15); /* Bleu Bootstrap */
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4); /* halo plus marqué */
    transform: scale(1.02);
    z-index: 1;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s, transform 0.2s;
}

.dimmed-step {
    opacity: 0.85;
    filter: grayscale(5%) brightness(1.05) contrast(1.2);
    color: #6c757d; /* gris moyen de Bootstrap */
    transition: opacity 0.2s ease-in-out, filter 0.2s ease-in-out, color 0.2s ease-in-out;
}


.step-draft {
    background-color: #e8e0ff; /* Violet pastel */
    border-left: 4px dashed #6c63ff;
    padding: 0.5rem;
    border-radius: 8px;
    position: relative;
}

.step-draft-label {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #6c63ff;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}


.editable-title:hover .edit-hint {
    opacity: 1;
}

.step-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.dot-and-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.cell-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2px;
    line-height: 1.1;
}

.meta-agent {
    font-size: 0.8rem;
    font-weight: 600;
    color: #212529; /* texte sombre */
}

.meta-intervention {
    font-size: 0.75rem;
    color: #6c757d; /* gris bootstrap */
}

/* ===== Desktop compact (≥ 561px) ===== */
@media (min-width: 561px) {
    .step-row {
        align-items: center; /* centrage vertical */
        flex-wrap: nowrap; /* une seule ligne */
        gap: 8px; /* espace réduit */
    }

    .title-wrap {
        flex: 0 1 28rem; /* largeur raisonnable du titre */
        min-width: 12rem; /* évite le wrap intempestif */
    }

    /* Le titre ne doit pas étirer la hauteur */
    .step-label {
        margin: 0;
        line-height: 1.15;
        display: -webkit-box; /* clamp à 2 lignes */
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    /* Mode édition compact */
    .title-wrap .form-control-sm {
        padding-top: .15rem;
        padding-bottom: .15rem;
        line-height: 1.1;
    }

    .title-wrap .mt-2 {
        margin-top: .25rem !important;
    }

    .title-wrap small {
        margin-top: .15rem !important;
        font-size: .7rem;
    }

    /* Le panneau reste sur une ligne et n'étire pas ses enfants */
    .panel-wrap > * {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
        min-height: 0;
    }

        .panel-wrap > * > * {
            flex: 0 0 auto; /* taille au contenu (boutons/inputs) */
            min-width: 0;
        }
}

.protocol-sections-sticky {
    position: sticky;
    top: 0; /* ajuste si tu as une navbar fixe */
    z-index: 1050;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-radius: 0 0 12px 12px; /* arrondi uniquement en bas */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* inertie iOS */
    padding: 6px 0;
}

/* Mobile : plus compact */
@media (max-width: 575.98px) {
    .protocol-sections-sticky {
        padding: 4px 0;
        box-shadow: 0 3px 10px rgba(0,0,0,0.10);
        border-radius: 0 0 16px 16px; /* arrondi un peu plus marqué en mobile */
    }
}

/* Base : bouton flottant (large) */
.vp-float {
    position: fixed;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 9999px;
    border: none;
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    color: #fff;
    user-select: none;
    touch-action: manipulation;
    /* centrage vertical par défaut pour left / right */
    top: 50%;
    transform: translateY(-50%);
}

/* Position aux bords */
.vp-left {
    left: max(16px, env(safe-area-inset-left));
}

.vp-right {
    right: max(16px, env(safe-area-inset-right));
}

/* Cancel en bas à gauche (avec marge, pas collé) */
.vp-bottom-left {
    left: max(16px, env(safe-area-inset-left));
    bottom: max(100px, env(safe-area-inset-bottom)); /* ajuste 100px si besoin */
    top: auto;
    right: auto;
    transform: none; /* pas de translate vertical ici */
}

/* === ÉTATS GÉNÉRIQUES === */

/* Actif (BLEU Bootstrap) */
.vp-on {
    background: #0d6efd;
    color: #fff;
}

    .vp-on:hover {
        background: #0b5ed7;
        box-shadow: 0 12px 30px rgba(0,0,0,.30);
    }
/* garder la bonne translation au hover selon la position */
.vp-left.vp-on:hover, .vp-right.vp-on:hover {
    transform: translateY(-50%) scale(1.08);
}

.vp-bottom-left.vp-on:hover {
    transform: scale(1.08);
}

/* Succès (VERT Bootstrap) */
.vp-success {
    background: #198754;
    color: #fff;
}

.vp-left.vp-success:hover, .vp-right.vp-success:hover {
    transform: translateY(-50%) scale(1.08);
    background: #157347;
}

.vp-bottom-left.vp-success:hover {
    transform: scale(1.08);
    background: #157347;
}

/* Désactivé (GRIS CLAIR neutre) */
.vp-off,
.vp-float:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    opacity: 1;
}

.vp-left.vp-off:hover, .vp-right.vp-off:hover {
    transform: translateY(-50%);
}

.vp-bottom-left.vp-off:hover {
    transform: none;
}

/* === COULEUR SPÉCIALE POUR CANCEL (rouge adouci, toujours actif) === */
/* Cancel : carré arrondi, plus petit, rouge doux */
.vp-cancel {
    width: 56px;
    height: 56px;
    border-radius: 12px; /* coins arrondis, pas un cercle */
    font-size: 26px;
    background: #e06666;
    color: #fff;
}

.vp-bottom-left.vp-cancel:hover {
    background: #cc4d4d;
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(0,0,0,.30);
}

.vp-cancel:focus-visible {
    outline: 3px solid #f5c2c7;
    outline-offset: 3px;
}

/* Sur mobile : un peu plus grand */
@media (max-width: 575.98px) {
    .vp-cancel {
        width: 64px;
        height: 64px;
        font-size: 30px;
    }
}

/* ==== Safe bottom spacing for Cancel (footer + expander + marge) ==== */
:root {
    --footer-h: 56px; /* fallback si non défini dans le MainLayout */
    --expander-trigger-h: 64px; /* hauteur du bouton "Toutes les étapes" */
    --cancel-gap: 24px; /* marge confortable au-dessus de la barre */
}

/* Quand la barre .expander-fixed est présente, on remonte Cancel */
body:has(.expander-fixed) .vp-bottom-left,
body:has(.expander-fixed) .vp-cancel {
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap));
    z-index: 1060; /* au-dessus de la barre (1050) et du footer (1040) */
}

/* Safe-area mobile (iPhone, etc.) */
@media (max-width: 575.98px) {
    body:has(.expander-fixed) .vp-bottom-left,
    body:has(.expander-fixed) .vp-cancel {
        bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap) + env(safe-area-inset-bottom));
    }
}


/* Toujours au-dessus du panneau (1045) et de la barre (1050) */
.vp-float, .vp-bottom-left, .vp-cancel {
    z-index: 2001 !important;
}

/* Quand la barre d'expander est présente, on remonte Cancel au-dessus du footer + barre */
:root {
    --footer-h: 56px; /* fallback si non défini dans MainLayout */
    --expander-trigger-h: 64px; /* hauteur du bouton "Toutes les étapes" */
    --cancel-gap: 24px; /* marge d'air */
}

/* version auto si :has est supporté */
body:has(.expander-fixed) .vp-bottom-left,
body:has(.expander-fixed) .vp-cancel {
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap));
}

/* fallback sans :has -> mets .with-expander sur <body> ou un wrapper */
.with-expander .vp-bottom-left,
.with-expander .vp-cancel {
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap));
}

/* Safe-area mobile */
@media (max-width: 575.98px) {
    body:has(.expander-fixed) .vp-bottom-left,
    body:has(.expander-fixed) .vp-cancel,
    .with-expander .vp-bottom-left,
    .with-expander .vp-cancel {
        bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap) + env(safe-area-inset-bottom));
    }
}

/* Barre CR devient un bloc compact centré */
.expander-report-fixed {
    position: fixed;
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1048;
    /* aspect bouton */
    background: #fff;
    border: 2px solid var(--acc, #3b82f6);
    border-radius: 12px;
    box-shadow: 0 -4px 12px rgba(0,0,0,.12);
    /* largeur réduite */
    width: auto;
    max-width: 90vw;
    padding: .5rem 1rem;
}

    /* couleur de fond bleue claire si tu veux garder l’accent */
    .expander-report-fixed.accent-blue {
        background: var(--acc-softer, #eff6ff);
    }


/* Le conteneur qui entoure le texte + StepButton sert d'ancre */
.report-anchor {
    position: relative;
}

/* Popup centré AU-DESSUS du bouton */
.report-popup--above {
    position: absolute;
    bottom: calc(100% + 10px); /* ↑ au-dessus de l’ancre */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1049;
    width: min(600px, 95vw);
    min-width: 300px;
    min-height: 180px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    resize: both;
    overflow: auto;
}

    /* Petite flèche qui pointe vers le bouton (optionnel) */
    .report-popup--above::after {
        content: "";
        position: absolute;
        bottom: -6px; /* colle sous le popup */
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 12px;
        height: 12px;
        background: #fff;
        border-left: 1px solid #e9ecef;
        border-bottom: 1px solid #e9ecef;
    }

/* Hauteur "réservée" pour le bloc CR/Photo */
:root {
    --cr-block-h: 72px; /* ajuste (64–88px selon ton contenu) */
    --cr-gap: 8px; /* petit espace visuel */
}

/* Le bloc CR/Photo a au moins cette hauteur (utile si le contenu wrap) */
.expander-report-fixed {
    min-height: var(--cr-block-h);
}

/* IMPORTANT : le panneau se place au-dessus de la barre + CR/Photo */
.expander-panel {
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h) + var(--cr-block-h) + var(--cr-gap));
    padding-bottom: 16px; /* petit confort au fond du panel */
    z-index: 1045;
}

/* Ordre des couches (pour mémoire) */
.expander-report-fixed {
    z-index: 1048;
}

.report-popup--above {
    z-index: 1049;
}

.expander-fixed {
    z-index: 1050;
}


@media (max-width: 575.98px) {
    .expander-report-fixed {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Effet fondu utilitaires (si utilisé) */
.alert-fade {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

    .alert-fade.show {
        opacity: 1;
    }

/* =========================
   Toolbar compacte (1 ligne)
   ========================= */
.toolbar-compact {
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

    .toolbar-compact .btn {
        padding: .25rem .45rem;
        line-height: 1;
    }

        .toolbar-compact .btn.btn-sm {
            font-size: .9rem;
        }

/* Option: rend la barre globale plus compacte */
.expander-report-fixed.compact .container {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

.expander-report-fixed.compact .gap-3,
.expander-report-fixed.compact .gap-4 {
    gap: .5rem !important;
}

.expander-report-fixed.compact small,
.expander-report-fixed.compact .small {
    font-size: .75rem;
}


/* =========================
   Boutons icône + libellé
   ========================= */
.btn-labeled {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

    .btn-labeled .icon,
    .btn-labeled .label {
        line-height: 1;
    }

/* =========================
   Pilules (même style partout)
   ========================= */
:root {
    --chip-border: #d0d7de; /* gris clair */
    --chip-bg: #f8fafc; /* fond très clair */
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
    border: 2px solid var(--chip-border);
    background: var(--chip-bg);
    border-radius: 9999px;
    padding: .35rem .6rem;
}

.chip-title {
    font-size: .8rem;
    color: #6c757d;
    line-height: 1;
    white-space: nowrap;
}

/* Lien "Annuler" */
.chip-cancel {
    font-size: .78rem;
    color: #6c757d;
    text-decoration: none;
    padding: 0;
}

    .chip-cancel:hover {
        text-decoration: underline;
    }

/* Empêche le bouton Compte-rendu de se comprimer */
.report-anchor .btn {
    white-space: nowrap;
}

/* Variante “empilée” : titre, actions, puis Annuler centré en bas */
.chip--stacked {
    flex-direction: column;
    align-items: center; /* centre horizontalement tous les enfants */
}

    .chip--stacked .chip-title {
        text-align: center;
    }

    .chip--stacked .actions {
        display: flex;
        align-items: center;
        gap: .35rem;
    }

.chip-footer {
    display: flex !important;
    justify-content: center;
    margin-top: .25rem;
}

/* A — défaut : une seule ligne défilable */
.toolbar-compact {
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

    .toolbar-compact .btn {
        padding: .25rem .45rem;
        line-height: 1;
    }

        .toolbar-compact .btn.btn-sm {
            font-size: .9rem;
        }

/* =========================================================
   Mobile (<= 576px) — toolbar ultra serrée
   ========================================================= */
@media (max-width: 576px) {

    .toolbar-compact.toolbar-wrap-sm {
        flex-wrap: nowrap !important;
        white-space: nowrap;
        overflow-x: auto;
        gap: .15rem; /* réduit l'espacement horizontal */
        width: -moz-fit-content;
        width: fit-content;
        max-width: 100%;
        margin: 0 auto;
    }

        /* Chips réduites au strict minimum */
        .toolbar-compact.toolbar-wrap-sm .chip {
            flex: 0 0 auto !important;
            min-width: unset;
            padding: .2rem .3rem; /* réduit au max */
            gap: .2rem;
            border-width: 1px;
        }

        /* Masquer les titres */
        .toolbar-compact.toolbar-wrap-sm .chip-title {
            display: none !important;
        }

        /* Actions serrées */
        .toolbar-compact.toolbar-wrap-sm .chip .actions {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
            gap: .2rem; /* moins d’espace entre boutons */
        }

        /* Boutons ultra compacts */
        .toolbar-compact.toolbar-wrap-sm .actions .btn {
            padding: .15rem .25rem; /* ↓ encore plus petit */
            line-height: 1;
            font-size: .95rem;
            white-space: nowrap;
        }

        /* Icônes seules */
        .toolbar-compact.toolbar-wrap-sm .btn-labeled .label {
            display: none !important;
        }

        .toolbar-compact.toolbar-wrap-sm .btn-labeled .icon {
            font-size: 1.1rem; /* légèrement réduit pour gagner en densité */
        }

        /* Badge discret */
        .toolbar-compact.toolbar-wrap-sm .badge {
            font-size: .65rem;
            padding: .1rem .25rem;
            transform: translateY(-2px);
        }

        /* Footer Annuler collé aux actions */
        .toolbar-compact.toolbar-wrap-sm .chip-footer {
            display: flex !important;
            justify-content: center;
            margin-top: .05rem; /* quasi collé */
        }

            .toolbar-compact.toolbar-wrap-sm .chip-footer .chip-cancel {
                font-size: 0;
                padding: 0; /* supprime tout padding texte */
                line-height: 1;
            }

                .toolbar-compact.toolbar-wrap-sm .chip-footer .chip-cancel::before {
                    content: "↩️";
                    font-size: 1.1rem; /* légèrement plus petit pour marquer “secondaire” */
                    vertical-align: middle;
                }
}

/* Mobile (<=576px) — ultra compact & plus fort que Bootstrap */
@media (max-width: 576px) {

    /* 0) Le conteneur s'adapte au contenu et NE garde pas gap-2 */
    .toolbar-compact.toolbar-wrap-sm {
        flex-wrap: nowrap !important;
        white-space: nowrap;
        overflow-x: auto;
        width: -moz-fit-content;
        width: fit-content;
        max-width: 100%;
        margin: 0 auto;
        gap: .1rem !important; /* <-- écrase .gap-2 */
    }

        /* 1) Chips vraiment serrées */
        .toolbar-compact.toolbar-wrap-sm .chip {
            flex: 0 0 auto !important;
            min-width: unset;
            padding: .12rem .22rem !important; /* ↓ encore moins de padding */
            gap: .15rem !important;
            border-width: 1px !important; /* au lieu de 2px */
            background: var(--chip-bg); /* ok */
        }

        /* Masquer les titres en mobile */
        .toolbar-compact.toolbar-wrap-sm .chip-title {
            display: none !important;
        }

        /* 2) Ligne d’actions côte à côte, sans marges fantômes */
        .toolbar-compact.toolbar-wrap-sm .chip .actions {
            display: flex;
            flex-direction: row !important;
            align-items: center;
            justify-content: center;
            gap: .15rem !important;
        }

            .toolbar-compact.toolbar-wrap-sm .chip .actions > * {
                margin: 0 !important; /* kill marges internes éventuelles */
            }

        /* 3) Boutons : override variables Bootstrap (plus fiable) */
        .toolbar-compact.toolbar-wrap-sm .actions .btn {
            --bs-btn-padding-y: .08rem;
            --bs-btn-padding-x: .22rem;
            --bs-btn-line-height: 1;
            --bs-btn-border-width: 1px;
            font-size: .9rem !important;
            padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x) !important;
            line-height: var(--bs-btn-line-height) !important;
            border-width: var(--bs-btn-border-width) !important;
            white-space: nowrap;
        }

        /* Icônes seules (labels masqués) */
        .toolbar-compact.toolbar-wrap-sm .btn-labeled .label {
            display: none !important;
        }

        .toolbar-compact.toolbar-wrap-sm .btn-labeled .icon {
            font-size: 1.05rem;
        }

        /* Badge discret */
        .toolbar-compact.toolbar-wrap-sm .badge {
            font-size: .65rem !important;
            padding: .08rem .22rem !important;
            transform: translateY(-2px);
        }

        /* Footer Annuler juste sous les deux icônes */
        .toolbar-compact.toolbar-wrap-sm .chip-footer {
            display: flex !important;
            justify-content: center;
            margin-top: .04rem !important; /* collé */
        }

            .toolbar-compact.toolbar-wrap-sm .chip-footer .chip-cancel {
                font-size: 0 !important; /* texte masqué */
                padding: 0 !important;
                line-height: 1 !important;
            }

                .toolbar-compact.toolbar-wrap-sm .chip-footer .chip-cancel::before {
                    content: "↩️";
                    font-size: 1.05rem; /* discrète car action secondaire */
                    vertical-align: middle;
                }
}

/* Mobile (<=576px) — exceptions : Photo et Compte-rendu plus grands */
@media (max-width: 576px) {

    /* 📷 Photo / Document */
    .toolbar-compact.toolbar-wrap-sm [aria-labelledby="photo-doc-title"] .actions .btn,
    .toolbar-compact.toolbar-wrap-sm [aria-labelledby="photo-doc-title"] .actions label {
        --bs-btn-padding-y: .18rem;
        --bs-btn-padding-x: .35rem;
        font-size: 1.1rem !important;
        padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x) !important;
    }

    .toolbar-compact.toolbar-wrap-sm [aria-labelledby="photo-doc-title"] .btn-labeled .icon {
        font-size: 1.3rem; /* icône plus visible */
    }

    /* 📝 Compte-rendu */
    .toolbar-compact.toolbar-wrap-sm .report-anchor .actions .btn {
        --bs-btn-padding-y: .2rem;
        --bs-btn-padding-x: .4rem;
        font-size: 1.1rem !important;
        padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x) !important;
    }

        .toolbar-compact.toolbar-wrap-sm .report-anchor .actions .btn .icon {
            font-size: 1.3rem;
        }
}

/* Empile Annuler + hint proprement dans le footer */
.footer-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
}

/* Texte (hint) par défaut = Desktop */
.chip-footer .hint {
    font-size: .85rem; /* un peu plus grand en desktop */
    font-weight: 500; /* semi-bold pour être lisible */
    color: #495057; /* gris foncé */
    text-align: center;
    line-height: 1.2;
}

/* Mobile (<=576px) : texte plus petit */
@media (max-width: 576px) {
    .chip-footer .hint {
        font-size: .65rem;
        font-weight: normal;
        color: #6c757d; /* gris plus clair */
    }
}

/* =========================
   Mobile (<=576px)
   ========================= */
@media (max-width: 576px) {

    /* Annuler en icône seule */
    .chip-footer .chip-cancel {
        font-size: 0;
        padding: 0;
        line-height: 1;
    }

        .chip-footer .chip-cancel::before {
            content: "↩️";
            font-size: 1.1rem;
            vertical-align: middle;
        }

    /* Halo plus grand autour des chips */
    .toolbar-compact.toolbar-wrap-sm .chip {
        padding: .25rem .35rem !important;
        border-radius: 1.2rem;
    }

    /* Espacement entre chips */
    .toolbar-compact.toolbar-wrap-sm {
        gap: .25rem !important;
    }
}

/* Icônes superposées (photo + document) */
.icon-stack {
    position: relative;
    display: inline-block;
    width: 1.6em;
    height: 1.6em;
}

    .icon-stack .icon-photo {
        position: absolute;
        bottom: 0;
        left: 0;
        font-size: 1.5em; /* par défaut (desktop) */
        z-index: 2; /* 📷 au-dessus */
    }

    .icon-stack .icon-doc {
        position: absolute;
        top: -0.15em;
        right: -0.15em;
        font-size: 1.1em;
        z-index: 1; /* derrière 📷 */
    }

        .icon-stack .icon-doc::before {
            content: "";
            position: absolute;
            inset: -0.15em;
            background: rgba(13,110,253,0.4); /* halo bleu marqué */
            border-radius: 50%;
            z-index: -1;
        }

/* 📱 Mobile (<=576px) : réduire 📷 */
@media (max-width: 576px) {
    .icon-stack {
        width: 1.4em; /* réduit un peu le conteneur */
        height: 1.4em;
    }

        .icon-stack .icon-photo {
            font-size: 1.2em; /* plus discret */
        }

        .icon-stack .icon-doc {
            font-size: 1em; /* cohérent avec la réduction */
        }
}


/* =========================
   Desktop (>=577px)
   ========================= */
@media (min-width: 577px) {
    .toolbar-compact .chip {
        padding: .45rem .7rem; /* halo plus grand */
        border-radius: 1.6rem; /* plus arrondi, effet halo doux */
        box-shadow: 0 2px 6px rgba(0,0,0,0.08); /* halo léger en ombre */
    }
}


/* Desktop = texte complet */
.only-desktop {
    display: inline;
}

.only-mobile {
    display: none;
}

/* Mobile : émojis centrés, sur une seule ligne */
@media (max-width: 576px) {
    .only-desktop {
        display: none !important;
    }

    .only-mobile {
        display: block !important; /* occupe la ligne */
        text-align: center; /* centre horizontalement */
        white-space: nowrap; /* pas de retour à la ligne */
        font-size: 1.1rem; /* lisible mais compact */
        letter-spacing: .05em; /* petit espacement entre émojis */
    }

    /* Optionnel : neutralise les effets de flex autour */
    .og-tools {
        width: 100%;
    }
    /* permet un vrai centrage */
}


/* Titre + message sur UNE ligne, sans wrap */
.og-tools {
  display: flex;
  align-items: baseline;
  gap: .5rem;               /* petit espace horizontal */
  white-space: nowrap;      /* pas de retour à la ligne */
}

/* Texte “cliquer pour…” compact et discret */
.accordion-msg {
  font-size: .85rem;
  color: #6c757d;
}

/* Supprime le chevron Bootstrap (on utilise .chev) */
.accordion--accent-blue .accordion-button::after { display: none; }

/* Réduit le padding vertical du bouton pour enlever le “blanc” */
.accordion--accent-blue .accordion-button {
  --bs-accordion-btn-padding-y: .125rem;
  --bs-accordion-btn-padding-x: .5rem;
  padding: var(--bs-accordion-btn-padding-y) var(--bs-accordion-btn-padding-x);
  line-height: 1.15;
}

/* Évite tout wrap du conteneur de ligne */
.accordion--accent-blue .accordion-button > .d-flex {
  align-items: center;
  gap: .25rem;
}

/* Option : réduis encore en mobile */
@media (max-width: 576px) {
  .og-tools { gap: .35rem; }
  .accordion-msg { font-size: .8rem; }
}

/* Si le bandeau extérieur a trop de padding, compresse-le */
.expander-fixed.p-2 { padding-top: .25rem !important; padding-bottom: .25rem !important; }
@media (max-width:576px){
  .expander-fixed.p-2 { padding-top: .15rem !important; padding-bottom: .15rem !important; }
}

/* Conteneur relatif pour ancrer le message en bas */
.accordion--accent-blue .acc-head {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 38px; /* hauteur mini du header */
}

    /* Ligne du haut (titre/émojis) */
    .accordion--accent-blue .acc-head .topline {
        white-space: nowrap; /* évite le retour à la ligne */
        gap: .5rem;
    }

/* Message en bas, ne prend pas de place layout (absolute) */
.accordion--accent-blue .accordion-msg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    text-align: left; /* mets "center" si tu préfères */
    font-size: .85rem;
    line-height: 1;
    color: #6c757d;
    pointer-events: none;
}

/* On réserve un peu d'espace en bas dans le bouton */
.accordion--accent-blue .accordion-button {
    padding: .2rem .5rem .9rem; /* bottom ↑ pour loger la ligne fixée */
    line-height: 1.15;
}

    /* Toggle auto du texte en fonction de l'état */
    .accordion--accent-blue .accordion-button .expanded-text {
        display: none;
    }

    .accordion--accent-blue .accordion-button[aria-expanded="true"] .expanded-text {
        display: inline;
    }

    .accordion--accent-blue .accordion-button[aria-expanded="true"] .collapsed-text {
        display: none;
    }

/* Mobile : encore plus compact si besoin */
@media (max-width: 576px) {
    .accordion--accent-blue .accordion-button {
        padding: .15rem .5rem .8rem;
    }

    .accordion--accent-blue .accordion-msg {
        font-size: .8rem;
        bottom: 1px;
    }

    .accordion--accent-blue .acc-head .topline {
        gap: .35rem;
    }
}

/* Message en bas : 1 seule ligne + ellipsis + marge pour le chevron */
.accordion--accent-blue .accordion-msg {
    position: absolute;
    left: 1.25rem; /* espace pour .chev à gauche */
    right: .5rem; /* léger padding à droite */
    bottom: 2px;
    white-space: nowrap; /* ⛔ pas de retour à la ligne */
    overflow: hidden; /* cache l'excédent */
    text-overflow: ellipsis; /* … si trop long */
    font-size: .85rem;
    line-height: 1;
    color: #6c757d;
    pointer-events: none;
}

/* Réserve la place en bas dans le bouton (line-height + marge) */
.accordion--accent-blue .accordion-button {
    padding: .2rem .5rem .9rem;
    line-height: 1.15;
}

/* Mobile : un poil plus compact, toujours 1 ligne */
@media (max-width:576px) {
    /* Message en bas : pas d'ellipsis, 1 seule ligne, s'adapte en taille */
    .accordion--accent-blue .accordion-msg {
        position: absolute;
        left: 1.1rem; /* laisse la place au chevron .chev */
        right: .5rem;
        bottom: 2px;
        white-space: nowrap; /* ⛔ pas de retour à la ligne */
        overflow: visible; /* pas de rognage → pas de "..." */
        text-overflow: clip; /* sécurité : pas d'ellipsis */
        font-size: clamp(.72rem, 2.6vw, .85rem); /* rétrécit un peu en mobile */
        line-height: 1;
        color: #6c757d;
        pointer-events: none;
    }

    /* Réserve la place en bas pour ce texte */
    .accordion--accent-blue .accordion-button {
        padding: .2rem .5rem .9rem;
        line-height: 1.15;
    }

    /* Très petits écrans : mini ajustement */
    @media (max-width: 360px) {
        .accordion--accent-blue .accordion-msg {
            font-size: clamp(.68rem, 3vw, .8rem);
        }
    }

}

/* === Paramètres (hauteurs + marge “doigt”) === */
:root {
    --vp-prev-size: 72px; /* taille flèche Prev */
    --vp-cancel-size: 56px; /* taille Cancel desktop */
    --vp-gap-left: 96px; /* ⬅️ beaucoup plus d’espace (avant: 18–22px) */
}

/* Mobile : encore plus d’espace + Cancel plus grand */
@media (max-width: 575.98px) {
    :root {
        --vp-cancel-size: 64px;
        --vp-gap-left: 120px; /* ⬅️ très spacieux en mobile */
    }
}


/* === Cancel au-dessus de la flèche gauche, aligné colonne gauche === */
.vp-cancel-above-left {
    position: fixed;
    /* même x que .vp-left (respecte safe-area) */
    left: max(16px, env(safe-area-inset-left));
    /* place le centre de Cancel au-dessus du centre de Prev avec une marge */
    top: calc( 50% - ( (var(--vp-prev-size) + var(--vp-cancel-size)) / 2 + var(--vp-gap-left) ) );
    z-index: 2001;
    transform: none; /* surtout pas translateY(-50%) ici */
}

    /* Hover cohérent (sans translateY, vu que top est absolu) */
    .vp-cancel-above-left.vp-on:hover {
        transform: scale(1.08);
    }

    .vp-cancel-above-left.vp-success:hover {
        transform: scale(1.08);
        background: #157347;
    }

    .vp-cancel-above-left.vp-off:hover {
        transform: none;
    }



@media (max-width: 576px) {
    /* Boutons validation (Coche / Voix) */
    .chip .actions .btn {
        padding: .55rem .65rem; /* ← un peu plus large que .55rem */
        font-size: 1.05rem;
        min-width: auto; /* largeur auto, pas forcée */
        height: 46px; /* bonne surface verticale */
    }

    /* Espacement entre boutons */
    .chip .actions {
        gap: .55rem; /* léger plus large que .5rem */
    }

        /* Icônes */
        .chip .actions .icon {
            font-size: 1.2rem;
        }
}


/* === Mobile (≤576px): emoji + panel on one line (centered), title below === */
@media (max-width: 576px) {
    /* Step row */
    .etapes-scroll-responsive .step-row {
        display: flex;
        flex-wrap: wrap; /* allows title to wrap to next line */
        justify-content: center; /* center the emoji+panel block */
        align-items: center; /* align emoji & panel vertically */
        column-gap: 1.25rem; /* space between emoji and panel */
        row-gap: .25rem; /* small vertical gap to the title */
    }

        .etapes-scroll-responsive .step-row > .etape-icon {
            order: 1;
            flex: 0 0 44px;
            display: flex;
            justify-content: center;
        }

        .etapes-scroll-responsive .step-row > .panel-wrap {
            order: 2;
            flex: 0 1 auto;
            margin-left: 0;
        }

        .etapes-scroll-responsive .step-row > .title-wrap {
            order: 3;
            flex: 0 0 100%;
            text-align: center;
            margin-top: .25rem;
        }

}

/* Mobile (≤576px) : cacher la flèche "↓" et récupérer l'espace */
@media (max-width: 576px) {
    /* 1) Cacher l'élément flèche lui-même */
    .etapes-scroll-responsive .arrow-step {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

        .etapes-scroll-responsive .arrow-step::before {
            content: none !important;
        }

    /* 2) Cacher son WRAPPER (ex: <div class="d-flex ... mt-3">) pour supprimer la marge */
    .etapes-scroll-responsive .d-flex:has(> .arrow-step) {
        display: none !important;
    }
}




/* Mobile (≤576px) : # + titre EN HAUT, puis EMOJI + PANEL en dessous sur 1 ligne */
@media (max-width: 576px) {
    .etapes-scroll-responsive .step-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        column-gap: .9rem; /* espace entre emoji et panel */
        row-gap: .25rem; /* petite marge entre le titre et la ligne du dessous */
    }

        /* 1) # + titre : en premier, pleine largeur, centré */
        .etapes-scroll-responsive .step-row > .title-wrap {
            order: 1;
            flex: 0 0 100%;
            text-align: center;
            margin: 0 !important;
        }

        .etapes-scroll-responsive .step-row .editable-title {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin: 0 !important;
            line-height: 1.2;
        }

        .etapes-scroll-responsive .step-row .step-id-inline {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: .85rem;
            color: #6c757d;
            border: 1px solid #dee2e6;
            border-radius: .35rem;
            padding: .05rem .35rem;
            margin-right: .35rem;
            flex: 0 0 auto;
        }

        /* 2) Emoji + Panel sur la deuxième ligne */
        .etapes-scroll-responsive .step-row > .etape-icon {
            order: 2;
            flex: 0 0 44px;
            display: flex;
            justify-content: center;
        }

        .etapes-scroll-responsive .step-row > .panel-wrap {
            order: 3;
            flex: 0 1 auto;
            margin-left: 0;
        }
}

/* Ligne titre: texte + icône d’édition à droite */
.step-title-row {
    display: flex;
    align-items: center;
    gap: .35rem;
}

    /* Troncature propre du texte */
    .step-title-row .step-title-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1 1 auto;
    }

    /* Icône d’édition: discrète par défaut, plus visible au survol/focus */
    .step-title-row .edit-hint {
        flex: 0 0 auto;
        color: #999;
        font-size: .85rem; /* discret */
        opacity: .45; /* 👈 visible en permanence desktop & mobile */
        transition: opacity .2s ease;
        user-select: none;
        pointer-events: none; /* ne bloque pas le double-clic */
    }

    .step-title-row:hover .edit-hint,
    .step-title-row:focus-within .edit-hint {
        opacity: 1; /* survol/focus : plus net */
    }

/* Optionnel: léger soulignement pointillé au survol (desktop) */
@media (hover: hover) and (pointer: fine) {
    .step-title-row:hover .step-title-text {
        text-decoration: underline dotted rgba(0,0,0,.35);
        text-underline-offset: .15em;
    }
}


/* Mobile (≤576px) : Statut:[emoji] + "Remarques :" à gauche, champ à droite */
@media (max-width: 576px) {
    .remarks-block {
        display: grid;
        grid-template-columns: auto 1fr; /* label | contenu */
        align-items: center;
        column-gap: .75rem;
        row-gap: .25rem;
    }

        .remarks-block .remarks-label {
            grid-column: 1 / 2;
            display: inline-flex;
            align-items: center;
            gap: .5rem; /* espace entre la puce statut et "Remarques :" */
            margin: 0;
        }

        .remarks-block .status-chip-mobile {
            display: inline-flex !important;
            align-items: center;
            gap: .35rem;
            color: #6c757d;
            border: 1px dashed #ced4da;
            border-radius: 9999px;
            padding: .05rem .4rem;
            font-size: .8rem;
            line-height: 1.2;
        }

            .remarks-block .status-chip-mobile .status-emoji {
                font-size: 1rem;
                line-height: 1;
            }

        .remarks-block .input-group-remarks {
            grid-column: 2 / 3;
            margin-top: 0 !important;
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            column-gap: .75rem;
        }
}



/* Mobile (≤576px) : 2 colonnes (Statut | Remarques), 2 lignes (titre / contenu), compact */
@media (max-width: 576px) {
    .remarks-block {
        display: grid;
        grid-template-columns: auto 1fr; /* gauche: statut, droite: remarques */
        grid-template-rows: auto auto; /* L1: titres ; L2: contenus */
        align-items: start;
        column-gap: .75rem;
        row-gap: .2rem;
    }

        /* Colonne gauche : pile 'Statut' (titre + emoji) occupant 2 lignes */
        .remarks-block .remarks-label {
            grid-column: 1;
            grid-row: 1 / span 2; /* sur 2 lignes */
            display: inline-flex;
            align-items: center;
            margin: 0;
        }

        .remarks-block .status-stack-mobile {
            display: inline-flex !important;
            flex-direction: column;
            align-items: center;
            gap: .15rem;
            line-height: 1;
        }

        .remarks-block .status-stack-title {
            font-size: .75rem; /* = à Remarques */
            color: #6c757d;
        }

        .remarks-block .status-emoji {
            font-size: 1.05rem;
            line-height: 1;
        }

        /* Colonne droite : Titre 'Remarques' (même taille que 'Statut') */
        .remarks-block .remarks-title {
            grid-column: 2;
            grid-row: 1;
            font-size: .75rem; /* ⇦ demandé */
            line-height: 1.1;
            margin: 0;
            font-weight: 700;
        }

        /* Colonne droite : 🎙️ + textarea sous le titre, compact, bien aligné */
        .remarks-block .input-group-remarks {
            grid-column: 2;
            grid-row: 2;
            margin-top: 0 !important;
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            column-gap: .6rem; /* léger écart */
        }

        .remarks-block .btn-voice {
            padding: .3rem .45rem !important; /* plus petit */
            line-height: 1;
        }

        .remarks-block .emoji-mic {
            font-size: .95rem !important;
        }

        /* Champ compact ; si ✏️ dans le champ à gauche, garde-le */
        .remarks-block .remarks-input-wrap {
            position: relative;
            flex: 1 1 auto;
            min-width: 0;
        }

        .remarks-block .remarks-text {
            height: 34px; /* ⇦ plus petit */
            min-height: 34px;
            padding-top: .35rem; /* équilibre la hauteur */
            padding-bottom: .35rem;
            white-space: nowrap;
            overflow: hidden;
        }
        /* (si tu as ✏️ à gauche dans le champ) */
        .remarks-block .edit-inside-mobile-left {
            left: .45rem;
            font-size: .95rem;
            padding: .15rem .2rem;
        }
}



/* Mobile (≤576px) : ✏️ DANS le champ à gauche ; cacher '(modifiable)' */
@media (max-width: 576px) {
    /* 1) Cacher le bloc externe d'édition en mobile (bouton ✏️ + '(modifiable)') */
    .remarks-block .remarks-edit-controls {
        display: none !important;
    }

    /* 2) Ancre pour le ✏️ interne */
    .remarks-block .remarks-input-wrap {
        position: relative;
        flex: 1 1 auto;
        min-width: 0;
    }

    /* 3) Champ compact + place pour ✏️ à gauche */
    .remarks-block .remarks-text {
        padding-left: 2.1rem; /* espace réservé pour ✏️ */
        height: 34px; /* compact */
        min-height: 34px;
        white-space: nowrap;
        overflow: hidden;
    }

    /* 4) ✏️ à gauche DANS le champ, sans bordure/ombre/fond */
    .remarks-block .edit-inside-mobile-left {
        position: absolute;
        left: .45rem;
        top: 50%;
        transform: translateY(-50%);
        padding: .15rem .2rem;
        font-size: .95rem;
        line-height: 1;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        outline: none !important;
    }

    /* Si tu avais une ancienne variante '✏️ à droite', on la neutralise */
    .remarks-block .edit-inside-mobile {
        display: none !important;
    }
}


/* Mobile (≤576px) : Statut en gras/centré + alignement emoji statut = emoji voix */
@media (max-width: 576px) {
    /* Titre 'Statut' : gras + centré */
    .remarks-block .status-stack-title {
        font-weight: 700;
        text-align: center;
    }

    /* La pile 'Statut' occupe 2 lignes : on la centre verticalement dans la grille */
    .remarks-block .status-stack-mobile {
        align-self: center; /* centre la pile par rapport aux 2 lignes (titre+champ) */
    }

    /* Hauteur normalisée de la ligne 'contenu' (comme le champ remarque) */
    .remarks-block .remarks-text {
        height: 34px;
        min-height: 34px;
    }

    /* Emoji Statut : même hauteur que la ligne de contenu ⇒ aligné avec 🎙️ */
    .remarks-block .status-emoji {
        height: 34px;
        line-height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Bouton voix : force la même hauteur pour un alignement parfait avec l'emoji statut */
    .remarks-block .btn-voice {
        height: 34px !important;
        padding: 0 .45rem !important;
        display: inline-flex;
        align-items: center;
    }

    .remarks-block .emoji-mic {
        line-height: 1;
    }
}


/* Mobile: petit décalage vers le bas de l’emoji Statut */
@media (max-width: 576px) {
    .remarks-block .status-emoji {
        margin-top: .15rem; /* ≈ 2–3px ; ajuste à .1rem / .2rem si besoin */
    }
}
