/* ══ RECLASSER DES COMPTES (2026-09-25), préfixe rcl- ═══════════════════════════════════════════════════════════════════
   Pages/ReclasserComptes.razor (la fenêtre), Pages/ReclasserChoixLigne.razor (le choix d'une ligne), et ses points d'entrée
   dans la barre du cockpit (FinTreePopup : bouton « Reclasser », puce « Reclassements », bandeau après application).
   • Rang : 5620 / 5621, au-dessus du cockpit (1400) et des piles de boutons flottants (5000), au niveau des autres fenêtres du
     cockpit (topline 5500, clés analytiques et libellés 5600). Rendue HORS du conteneur du cockpit : aucun ancêtre à transform
     ou filtre ne capture son position:fixed. Elle-même n'a NI transform NI filtre (centrée par inset + margin:auto) : le voile
     fixe de son choix de ligne couvre bien tout l'écran.
   • Jetons de l'app (--surf-*, --tx*, --mut*, --o*, --brand, --brand-strong, --brand-contrast, --st-*) : clair et sombre.
     Accent en TEXTE : --brand-strong ; encre sur fond de marque : --brand-contrast.
   • Téléphone (≤ 640 px) : feuille du bas, un seul défilement, cibles de 44 px, jamais de hauteur en vh seule (iOS).
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── Barre du cockpit ─────────────────────────────────────────────────────────────────────────────────────────────── */
.rcl-ouvrir .iku-ico { width: 14px; height: 14px; color: var(--brand-strong, var(--brand, #00B1CF)); }
.rcl-ouvrir.has-sugg { border-color: color-mix(in srgb, var(--st-amber, #fbbf24) 45%, var(--o8)); }
/* Le mot suit le nombre par un gap : dans un conteneur flex, l'espace de tête d'un enfant est avalé (« 6suggestions »). */
.rcl-pastille {
    display: inline-flex; align-items: center; gap: .3em; height: 18px; padding: 0 7px; margin-left: 2px; border-radius: 999px;
    background: color-mix(in srgb, var(--st-amber, #fbbf24) 18%, transparent); color: var(--st-amber, #fbbf24);
    font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rcl-pastille b { font-weight: 800; }
.rcl-puce .iku-ico { width: 13px; height: 13px; }
.rcl-puce-n { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand-strong, var(--brand, #00B1CF)); }
@media (max-width: 640px) {
    .rcl-pastille-mot { display: none; }
    .rcl-puce { display: none; }   /* l'onglet Règles de la fenêtre garde les reclassements en vigueur */
}

/* Le copilote flottant passe au-dessus de tout (10050) : il s'efface tant que la fenêtre est ouverte. */
body:has(.rcl-modal) .cop-fab { display: none; }

/* ── Fenêtre ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
.rcl-back { position: fixed; inset: 0; z-index: 5620; background: var(--bd72, rgba(3,12,18,.72)); backdrop-filter: blur(2px); }
.rcl-modal {
    position: fixed; z-index: 5621; inset: 0; margin: auto;
    width: min(1240px, calc(100vw - 48px));
    height: min(860px, calc(100vh - 48px)); height: min(860px, calc(100dvh - 48px));
    display: flex; flex-direction: column; overflow: hidden; outline: none;
    background: var(--surf-2, #102733); color: var(--tx1, #eafdff); font-family: var(--font-family);
    border: 1px solid color-mix(in srgb, var(--brand, #00B1CF) 22%, transparent); border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
    animation: rcl-entree .16s ease-out;
}
html[data-theme="light"] .rcl-modal { background: #fff; box-shadow: 0 30px 80px rgba(30,41,59,.25); }
@keyframes rcl-entree { from { opacity: 0; } to { opacity: 1; } }

.rcl-head { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 14px; padding: 18px 22px 14px; border-bottom: 1px solid var(--o8); }
.rcl-head-ic {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--brand, #00B1CF) 16%, transparent); color: var(--brand-strong, var(--brand, #00B1CF));
}
.rcl-head-ic svg { width: 18px; height: 18px; }
.rcl-head-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rcl-titre { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.rcl-sous { margin: 0; max-width: 880px; font-size: 12.5px; line-height: 1.45; color: var(--mut1); }
.rcl-x {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--o10); background: transparent; color: var(--mut2);
}
.rcl-x:hover { background: var(--o6); color: var(--tx1); }
.rcl-x svg { width: 15px; height: 15px; }

.rcl-corps { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.rcl-gauche { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--o8); }
.rcl-droite {
    min-width: 0; min-height: 0; overflow-y: auto; padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 10px;
    background: var(--o3);
}
html[data-theme="light"] .rcl-droite { background: color-mix(in srgb, var(--brand, #00B1CF) 3%, #f6f9fb); }

/* ── Onglets ── */
.rcl-onglets { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 10px 18px 8px; overflow-x: auto; scrollbar-width: none; }
.rcl-onglets::-webkit-scrollbar { display: none; }
.rcl-onglet {
    display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 0; border-radius: 9px; cursor: pointer;
    background: none; color: var(--mut1); font-family: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.rcl-onglet:hover { color: var(--tx1); }
.rcl-onglet.on { background: color-mix(in srgb, var(--brand, #00B1CF) 16%, transparent); color: var(--tx1); }
.rcl-cnt {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px;
    background: var(--o8); color: var(--tx2); font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.rcl-cnt.is-sugg { background: color-mix(in srgb, var(--st-amber, #fbbf24) 18%, transparent); color: var(--st-amber, #fbbf24); }
.rcl-onglets-note { margin-left: auto; padding-left: 8px; font-size: 11.5px; color: var(--mut2); white-space: nowrap; }

/* ── Barre de sélection ── */
.rcl-barre {
    flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0 18px 8px; padding: 7px 10px 7px 12px;
    border-radius: 11px; background: var(--o4); border: 1px solid var(--o8);
}
.rcl-barre:has(.rcl-recherche) { padding: 0; background: none; border: 0; }
.rcl-tout { display: inline-flex; align-items: center; gap: 9px; min-height: 30px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.rcl-barre-sp { flex: 1 1 auto; }
.rcl-barre-lbl { font-size: 12px; color: var(--mut1); }
.rcl-chk { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--brand, #00B1CF); cursor: pointer; }
.rcl-chk:disabled { cursor: default; }
.rcl-recherche {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; border-radius: 10px;
    background: var(--o4); border: 1px solid var(--o10); color: var(--mut1);
}
.rcl-recherche:focus-within { border-color: color-mix(in srgb, var(--brand, #00B1CF) 60%, transparent); }
.rcl-recherche svg { flex: 0 0 auto; width: 14px; height: 14px; }
.rcl-recherche input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent; color: var(--tx1); font-family: inherit; font-size: 13px; }
.rcl-recherche input::placeholder { color: var(--mut3); opacity: 1; }

/* ── Listes ── */
.rcl-liste { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 18px 12px; display: flex; flex-direction: column; gap: 6px; }
.rcl-num { flex: 0 0 auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--mut1); font-variant-numeric: tabular-nums; }
.rcl-lib { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--tx1); }
.rcl-mt { flex: 0 0 auto; margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--tx1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rcl-pill {
    display: inline-flex; align-items: center; min-height: 22px; max-width: 100%; padding: 1px 9px; border-radius: 7px;
    background: var(--o5); border: 1px solid var(--o10); color: var(--tx2); font-size: 11.5px; font-weight: 600; line-height: 1.3;
}
.rcl-pill.is-to {
    background: color-mix(in srgb, var(--brand, #00B1CF) 12%, transparent); border-color: color-mix(in srgb, var(--brand, #00B1CF) 38%, transparent);
    color: var(--brand-strong, var(--brand, #00B1CF));
}
.rcl-fleche { flex: 0 0 auto; width: 14px; height: 14px; color: var(--brand-strong, var(--brand, #00B1CF)); }
.rcl-tag {
    display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; white-space: nowrap;
    background: var(--o6); color: var(--mut1); font-size: 10.5px; font-weight: 700;
}
.rcl-tag.is-info { background: color-mix(in srgb, var(--brand, #00B1CF) 12%, transparent); color: var(--brand-strong, var(--brand, #00B1CF)); }

/* Carte de suggestion */
.rcl-sugg { display: flex; gap: 12px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--o8); transition: border-color .12s, background .12s; }
.rcl-sugg:hover { border-color: var(--o14); }
.rcl-sugg.on { border-color: color-mix(in srgb, var(--brand, #00B1CF) 45%, transparent); background: color-mix(in srgb, var(--brand, #00B1CF) 6%, transparent); }
.rcl-sugg.is-vue { box-shadow: inset 3px 0 0 var(--st-amber, #fbbf24); }
.rcl-sugg > .rcl-chk { margin-top: 3px; }
.rcl-sugg-c { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rcl-sugg-l1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; cursor: pointer; }
.rcl-sugg-l2 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 7px; }
.rcl-sugg-l3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.rcl-conf { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.rcl-conf.is-haute { background: color-mix(in srgb, var(--st-green, #34d399) 14%, transparent); color: var(--st-green, #34d399); }
.rcl-conf.is-moyenne { background: color-mix(in srgb, var(--brand, #00B1CF) 12%, transparent); color: var(--brand-strong, var(--brand, #00B1CF)); }
.rcl-conf.is-faible { background: color-mix(in srgb, var(--st-red, #f87171) 13%, transparent); color: var(--st-red, #f87171); }
.rcl-why { font-size: 11.5px; line-height: 1.4; color: var(--mut1); }

/* Ligne de compte (« Tous les comptes ») : liste virtualisée, sans espacement entre les rangs (hauteurs mesurées). */
.rcl-liste-comptes { display: block; padding-top: 0; }
.rcl-cpt { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 3px 8px 3px 2px; border-bottom: 1px solid var(--o5); box-sizing: border-box; }
.rcl-cpt.on { background: color-mix(in srgb, var(--brand, #00B1CF) 7%, transparent); }
.rcl-cpt.is-lot { box-shadow: inset 3px 0 0 var(--brand, #00B1CF); }
.rcl-cpt.is-vue:not(.is-lot) { box-shadow: inset 3px 0 0 var(--st-amber, #fbbf24); }
.rcl-cpt-chk { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 40px; cursor: pointer; }
/* Impôt et amortissements : le moteur ne les déplace pas. Visibles, pas sélectionnables. */
.rcl-cpt.is-fige .rcl-cpt-chk { cursor: not-allowed; }
.rcl-cpt.is-fige .rcl-chk { opacity: .35; }
.rcl-cpt.is-fige .rcl-lib, .rcl-cpt.is-fige .rcl-mt { color: var(--mut1); }
.rcl-cpt > .rcl-num { width: 64px; }
.rcl-cpt-lib { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rcl-cpt-lib .rcl-lib { font-size: 12.5px; font-weight: 600; }
.rcl-cpt-lib small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--mut2); }
.rcl-cpt-vers { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 6px; }
.rcl-cpt-vers .rcl-pill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 240px; line-height: 20px; }
.rcl-cpt > .rcl-mt { min-width: 76px; text-align: right; font-weight: 600; }
.rcl-retirer {
    flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; cursor: pointer;
    border: 0; background: transparent; color: var(--mut2);
}
.rcl-retirer:hover { background: var(--o8); color: var(--tx1); }
.rcl-retirer svg { width: 12px; height: 12px; }

/* États vides */
.rcl-etat {
    margin: 22px auto; max-width: 470px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
    font-size: 12.5px; line-height: 1.45; color: var(--mut1);
}
.rcl-etat b { font-size: 13.5px; color: var(--tx1); }
.rcl-etat .rcl-btn { margin-top: 4px; }
.rcl-etat-ic {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--brand, #00B1CF) 14%, transparent); color: var(--brand-strong, var(--brand, #00B1CF));
}
.rcl-etat-ic.is-ok { background: color-mix(in srgb, var(--st-green, #34d399) 14%, transparent); color: var(--st-green, #34d399); }
.rcl-etat-ic svg { width: 20px; height: 20px; }
.rcl-vide { margin: 2px 0 6px; font-size: 12px; line-height: 1.45; color: var(--mut1); }

/* Onglet Règles */
.rcl-sec { margin: 10px 0 2px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mut1); }
.rcl-regle { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--o8); }
.rcl-date { font-size: 11px; color: var(--mut2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rcl-regle .rcl-date { margin-left: auto; }
.rcl-lotapp { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--o8); background: var(--o3); }
.rcl-lotapp-l1 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: 12.5px; }
.rcl-lotapp-l2 { display: flex; flex-wrap: wrap; gap: 6px; }
.rcl-mini { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 7px; background: var(--o5); font-size: 11px; color: var(--tx2); }

/* Règle par préfixe (bas de la colonne) */
.rcl-nouvelle {
    flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 9px; margin: 4px 18px 14px; padding: 10px 12px;
    border-radius: 11px; border: 1px dashed var(--o16); font-size: 12px; color: var(--tx2);
}
.rcl-nouvelle b { color: var(--tx1); }
.rcl-nouvelle-ic { display: inline-grid; color: var(--brand-strong, var(--brand, #00B1CF)); }
.rcl-nouvelle-ic svg { width: 15px; height: 15px; }
.rcl-prefixe {
    width: 76px; height: 30px; box-sizing: border-box; padding: 0 6px; border-radius: 8px; text-align: center;
    border: 1px solid var(--o16); background: var(--o4); color: var(--tx1);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 500;
}
.rcl-prefixe::placeholder { color: var(--mut3); opacity: 1; }
.rcl-prefixe:focus { outline: none; border-color: color-mix(in srgb, var(--brand, #00B1CF) 65%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #00B1CF) 16%, transparent); }
.rcl-nouvelle-note { color: var(--mut2); }
.rcl-nouvelle .rcl-choix-btn { min-width: 150px; max-width: 230px; }
/* Poussé à droite sur sa ligne ; s'il passe à la ligne, il y reste à droite. */
.rcl-nouvelle-go { margin-left: auto; }

/* ── Choix d'une ligne ─────────────────────────────────────────────────────────────────────────────────────────────── */
.rcl-choix { position: relative; display: inline-flex; min-width: 0; }
.rcl-choix-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 32px; min-width: 170px; max-width: 320px; padding: 0 10px; border-radius: 8px;
    border: 1px solid var(--o16); background: var(--o4); color: var(--tx1); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.rcl-choix-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand, #00B1CF) 50%, transparent); }
.rcl-choix-btn:disabled { opacity: .5; cursor: default; }
.rcl-choix-btn.is-vide .rcl-choix-val { color: var(--mut1); font-weight: 500; }
.rcl-choix-val { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.rcl-choix-chev { flex: 0 0 auto; width: 12px; height: 12px; color: var(--mut1); transition: transform .15s; }
.rcl-choix.is-open .rcl-choix-chev { transform: rotate(180deg); }
.rcl-choix-voile { position: fixed; inset: 0; z-index: 30; }
.rcl-choix-menu {
    position: absolute; z-index: 31; top: calc(100% + 4px); right: 0; width: max(100%, 320px); max-width: min(440px, calc(100vw - 32px));
    max-height: 340px; display: flex; flex-direction: column; overflow: hidden; border-radius: 11px;
    border: 1px solid var(--o12); background: var(--surf-2, #16212e); box-shadow: 0 18px 44px -12px rgba(0,0,0,.6);
}
.rcl-choix.is-haut .rcl-choix-menu { top: auto; bottom: calc(100% + 4px); }
html[data-theme="light"] .rcl-choix-menu { background: #fff; box-shadow: 0 18px 44px -12px rgba(30,41,59,.3); }
.rcl-choix-cherche {
    flex: 0 0 auto; display: flex; align-items: center; gap: 7px; height: 32px; margin: 6px 6px 2px; padding: 0 9px; border-radius: 8px;
    background: var(--o4); border: 1px solid var(--o10); color: var(--mut1);
}
.rcl-choix-cherche:focus-within { border-color: color-mix(in srgb, var(--brand, #00B1CF) 60%, transparent); }
.rcl-choix-cherche svg { flex: 0 0 auto; width: 13px; height: 13px; }
.rcl-choix-cherche input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent; color: var(--tx1); font-family: inherit; font-size: 12.5px; }
.rcl-choix-opts { overflow-y: auto; padding: 4px; }
.rcl-choix-grp {
    position: sticky; top: 0; z-index: 1; padding: 7px 10px 4px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: var(--mut1); background: var(--surf-2, #16212e);
}
html[data-theme="light"] .rcl-choix-grp { background: #fff; }
.rcl-choix-opt {
    display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer;
    color: var(--tx2); font-family: inherit; font-size: 12.5px; font-weight: 500; line-height: 1.3;
}
.rcl-choix-opt:hover, .rcl-choix-opt:focus-visible { background: color-mix(in srgb, var(--brand, #00B1CF) 10%, transparent); color: var(--tx1); outline: none; }
.rcl-choix-opt.on { background: color-mix(in srgb, var(--brand, #00B1CF) 16%, transparent); color: var(--brand-strong, var(--brand, #00B1CF)); font-weight: 700; }
.rcl-choix-opt.is-tete { font-weight: 700; }
.rcl-choix-vide { padding: 10px; font-size: 12px; color: var(--mut1); }

/* ── Panneau d'impact ──────────────────────────────────────────────────────────────────────────────────────────────── */
.rcl-imp-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.rcl-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tx2); }
.rcl-imp-sub { font-size: 11.5px; color: var(--mut2); }
.rcl-sec-t { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mut1); }
.rcl-lotprep { display: flex; flex-direction: column; gap: 6px; }
.rcl-prep-liste { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.rcl-prep {
    display: flex; align-items: center; gap: 7px; min-height: 30px; padding: 3px 4px 3px 9px; border-radius: 8px;
    background: var(--o4); border: 1px solid var(--o8); font-size: 12px;
}
.rcl-prep-l { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--tx1); }
.rcl-nb {
    display: flex; gap: 10px; padding: 11px 12px; border-radius: 11px; font-size: 12px; line-height: 1.45; color: var(--tx2);
    border: 1px solid color-mix(in srgb, var(--brand, #00B1CF) 30%, transparent); background: color-mix(in srgb, var(--brand, #00B1CF) 7%, transparent);
}
.rcl-nb b { display: block; margin-bottom: 2px; font-size: 12.5px; color: var(--tx1); }
.rcl-nb-ic { flex: 0 0 auto; display: inline-grid; padding-top: 1px; color: var(--brand-strong, var(--brand, #00B1CF)); }
.rcl-nb-ic svg { width: 16px; height: 16px; }
.rcl-calc { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mut1); }
.rcl-spin {
    flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; box-sizing: border-box;
    border: 2px solid color-mix(in srgb, var(--brand, #00B1CF) 25%, transparent); border-top-color: var(--brand, #00B1CF);
    animation: rcl-tourne .8s linear infinite;
}
@keyframes rcl-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rcl-spin { animation-duration: 2.4s; } .rcl-modal, .rcl-bandeau { animation: none; } }
.rcl-agg { display: flex; flex-direction: column; transition: opacity .15s; }
.rcl-agg.is-perime { opacity: .55; }
/* Colonnes fixes (chaque rang est sa propre grille : elles doivent s'aligner) ; « Écart » devient « Difference » en anglais,
   d'où la dernière plus large. Les en-têtes ne débordent jamais sur leur voisin. */
.rcl-agg-r { display: grid; grid-template-columns: minmax(0, 1fr) 70px 70px 86px; align-items: center; min-height: 28px; border-bottom: 1px solid var(--o6); font-size: 12.5px; }
.rcl-agg-r.is-tete { min-height: 24px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--mut2); }
.rcl-agg-r.is-tete > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcl-agg-r > span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.rcl-agg-r.is-cle { background: color-mix(in srgb, var(--brand, #00B1CF) 7%, transparent); }
.rcl-agg-r.is-cle .rcl-agg-n { font-weight: 800; }
.rcl-agg-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tx2); padding-left: 4px; }
.rcl-agg-v { color: var(--mut1); padding-right: 4px; }
.rcl-agg-v.is-apres { color: var(--tx1); font-weight: 700; }
.rcl-agg-v.is-nul { color: var(--mut3); }
.rcl-agg-v.is-ecart { color: var(--st-amber, #fbbf24); font-weight: 700; }
.rcl-lignes { display: flex; flex-direction: column; gap: 2px; }
.rcl-ligne-r { display: grid; grid-template-columns: minmax(0, 1fr) auto 118px; align-items: center; gap: 8px; min-height: 24px; font-size: 12px; }
.rcl-ligne-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tx2); }
.rcl-ligne-v { font-weight: 700; font-variant-numeric: tabular-nums; }
.rcl-ligne-v.is-plus { color: var(--brand-strong, var(--brand, #00B1CF)); }
.rcl-ligne-v.is-moins { color: var(--mut1); }
.rcl-ligne-p { text-align: right; font-size: 11.5px; color: var(--mut2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rcl-lignes.sans-previ .rcl-ligne-r { grid-template-columns: minmax(0, 1fr) auto; }
.rcl-ctrl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--tx2); }
.rcl-ctrl li { display: flex; gap: 8px; line-height: 1.4; }
.rcl-ctrl-ic { flex: 0 0 14px; font-weight: 800; text-align: center; }
.rcl-ctrl li.ok .rcl-ctrl-ic { color: var(--st-green, #34d399); }
.rcl-ctrl li.warn { color: var(--st-amber, #fbbf24); }
.rcl-ctrl li.ko { color: var(--st-red, #f87171); }
.rcl-imp-vide { margin-top: 6px; }

/* ── Pied ── */
.rcl-pied { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--o8); background: var(--o3); }
.rcl-pied-note, .rcl-msg { flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 1.4; color: var(--mut1); }
.rcl-msg { margin: 0; }
.rcl-msg.is-alerte { color: var(--st-amber, #fbbf24); }
.rcl-pied-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.rcl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px; cursor: pointer;
    border: 1px solid color-mix(in srgb, var(--brand, #00B1CF) 35%, transparent); background: transparent; color: var(--tx1);
    font-family: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.rcl-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--brand, #00B1CF) 10%, transparent); }
.rcl-btn:disabled { opacity: .5; cursor: default; }
.rcl-btn-go { background: var(--brand, #00B1CF); border-color: var(--brand, #00B1CF); color: var(--brand-contrast, #062028); font-weight: 800; }
.rcl-btn-go:hover:not(:disabled) { background: color-mix(in srgb, var(--brand, #00B1CF) 88%, #fff); }
.rcl-onglet:focus-visible, .rcl-btn:focus-visible, .rcl-x:focus-visible, .rcl-retirer:focus-visible, .rcl-choix-btn:focus-visible,
.rcl-chk:focus-visible, .rcl-bandeau-x:focus-visible {
    outline: 2px solid var(--brand, #00B1CF); outline-offset: 1px;
}

/* ── Bandeau après application (dans le cockpit, en bas au centre) ─────────────────────────────────────────────────── */
.rcl-bandeau {
    position: absolute; left: 50%; bottom: 22px; z-index: 50; transform: translateX(-50%); box-sizing: border-box;
    width: min(760px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 14px; border-radius: 14px;
    background: var(--surf-2, #102733); border: 1px solid color-mix(in srgb, var(--brand, #00B1CF) 30%, transparent);
    box-shadow: 0 18px 50px rgba(0,0,0,.5); font-family: var(--font-family); animation: rcl-entree .2s ease-out;
}
html[data-theme="light"] .rcl-bandeau { background: #fff; box-shadow: 0 18px 50px rgba(30,41,59,.25); }
.rcl-bandeau-ic {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: color-mix(in srgb, var(--st-green, #34d399) 16%, transparent); color: var(--st-green, #34d399);
}
.rcl-bandeau-ic svg { width: 15px; height: 15px; }
.rcl-bandeau-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.4; color: var(--mut1); }
.rcl-bandeau-txt b { font-size: 13px; color: var(--tx1); }
.rcl-bandeau-x {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer;
    border: 0; background: transparent; color: var(--mut2);
}
.rcl-bandeau-x:hover { background: var(--o8); color: var(--tx1); }
.rcl-bandeau-x svg { width: 13px; height: 13px; }

/* ── Écrans moyens : le panneau d'impact se resserre ── */
@media (max-width: 1100px) and (min-width: 641px) {
    .rcl-corps { grid-template-columns: minmax(0, 1fr) 350px; }
    .rcl-agg-r { grid-template-columns: minmax(0, 1fr) 60px 60px 80px; }
}

/* ── Téléphone : feuille du bas, un seul défilement, cibles de 44 px ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .rcl-modal {
        inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; height: calc(100vh - 10px); height: calc(100dvh - 10px);
        border-radius: 18px 18px 0 0; border-bottom: 0;
    }
    .rcl-head { gap: 10px; padding: 12px 12px 10px 14px; }
    .rcl-head-ic { width: 32px; height: 32px; }
    .rcl-titre { font-size: 16px; }
    .rcl-sous { font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .rcl-x { width: 44px; height: 44px; }
    .rcl-corps { display: block; overflow-y: auto; overscroll-behavior: contain; }
    .rcl-gauche { border-right: 0; }
    .rcl-onglets { padding: 6px 10px 6px; }
    .rcl-onglet { height: 44px; padding: 0 11px; }
    .rcl-onglets-note { display: none; }
    .rcl-barre { margin: 0 12px 8px; }
    .rcl-barre-sp { display: none; }
    .rcl-barre-lbl { flex-basis: 100%; }
    .rcl-tout { min-height: 44px; }
    .rcl-choix, .rcl-choix-btn { width: 100%; max-width: none; }
    .rcl-choix-btn { height: 44px; }
    .rcl-choix-menu { left: 0; right: 0; width: auto; max-width: none; max-height: min(52vh, 380px); max-height: min(52dvh, 380px); }
    .rcl-choix-opt { min-height: 44px; }
    .rcl-recherche { height: 44px; }
    .rcl-liste { max-height: min(58vh, 560px); max-height: min(58dvh, 560px); padding: 2px 12px 10px; }
    .rcl-sugg { padding: 12px 10px; }
    .rcl-sugg > .rcl-chk { width: 20px; height: 20px; margin-top: 1px; }
    .rcl-cpt { min-height: 58px; flex-wrap: wrap; row-gap: 4px; }
    .rcl-cpt-chk { width: 44px; height: 44px; }
    .rcl-cpt > .rcl-num { width: auto; }
    .rcl-cpt-lib { flex: 1 1 0; }
    .rcl-cpt > .rcl-mt { min-width: 0; }
    .rcl-cpt-vers { order: 5; flex-basis: 100%; padding-left: 44px; }
    .rcl-retirer { width: 44px; height: 44px; }
    .rcl-retirer svg { width: 14px; height: 14px; }
    .rcl-nouvelle { margin: 4px 12px 12px; }
    .rcl-prefixe { height: 44px; width: 96px; }
    .rcl-nouvelle .rcl-btn { flex-basis: 100%; }
    .rcl-droite { padding: 14px 12px 16px; border-top: 1px solid var(--o8); overflow: visible; }
    .rcl-prep { min-height: 44px; }
    .rcl-pied { flex-wrap: wrap; gap: 8px; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
    .rcl-pied-actions { width: 100%; }
    .rcl-pied-actions .rcl-btn { flex: 1 1 0; }
    .rcl-btn { min-height: 44px; }
    .rcl-bandeau { bottom: 12px; flex-wrap: wrap; }
    .rcl-bandeau .rcl-btn { flex: 1 1 auto; }
    .rcl-bandeau-x { width: 44px; height: 44px; }
}
