/* ══ GLOSSAIRE UNIQUE (2026-10-11, V6), préfixes gl- (le « ? ») et gls- (la fenêtre) ═════════════════════════════════════════════
   Services/Glossaire.cs (les définitions), Shared/TermeGlossaire.razor (le « ? »), Shared/GlossaireFenetre.razor (la fenêtre),
   js/app.js (la bulle .iku-tip mise en forme : .iku-tip-gl).
   • Le « ? » : 15 px dans le flux du texte, aucune marge verticale, la ligne ne grandit pas ; cible tactile agrandie par un
     pseudo-élément (jamais par la boîte). Couleur discrète, marque au survol et au focus.
   • La fenêtre : rang 10095 / 10096 (au-dessus du pilotage, du Reporting et des fenêtres ; sous la palette, 10101, qui se ferme
     avant), surface PLEINE comme la palette. Mat et Papier : surfaces et filets du style. Compact : resserrée. Téléphone (≤ 640 px) :
     plein écran, un seul défilement, cibles de 44 px, jamais de hauteur en vh seule (iOS).
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── Le « ? » ── */
.gl-q {
    position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 15px; height: 15px; margin: 0 0 0 4px; padding: 0; vertical-align: -2px;
    border-radius: 50%; border: 1px solid var(--o20, rgba(255,255,255,.22)); background: transparent;
    color: var(--mut1, #8aa0ad); font: 700 9.5px/1 var(--font-family, system-ui, sans-serif); letter-spacing: 0;
    cursor: help; user-select: none; text-transform: none;
    transition: color .12s, border-color .12s, background .12s;
}
.gl-q:hover, .gl-q:focus-visible {
    color: var(--brand-strong, var(--brand, #00B1CF)); border-color: color-mix(in srgb, var(--brand, #00B1CF) 60%, transparent);
    background: color-mix(in srgb, var(--brand, #00B1CF) 10%, transparent);
}
.gl-q:focus-visible { outline: 2px solid var(--anneau-focus, var(--brand, #00B1CF)); outline-offset: 1px; }
html[data-theme="light"] .gl-q { border-color: rgba(15, 38, 56, .28); color: #4b5d68; }
html[data-theme="light"] .gl-q:hover, html[data-theme="light"] .gl-q:focus-visible { color: #006f85; border-color: #3aa9bf; background: #e9f7fa; }
/* Cible tactile : 32 px autour du rond, sans bouger la ligne. */
.gl-q::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); }
@media (pointer: coarse) { .gl-q::after { width: 36px; height: 36px; } }
/* Dans un en-tête en capitales (tableaux, cartes) : le « ? » reste un « ? ». */
th .gl-q, .kpi-l .gl-q { text-transform: none; }
html[data-papier] .gl-q { border-color: var(--pp-trait-fort, rgba(0,0,0,.3)); }
html[data-density="compact"] .gl-q { width: 13px; height: 13px; font-size: 8.5px; margin-left: 3px; }
/* Dans un libellé de l'arbre (Reporting, analyses) : mesuré le 13/10/2026, le « ? » à -2px tombait 4 px sous le centre du
   texte et collait à 4 px du mot. 2px le centre à 0,3 px près ; 6 px d'écart. */
.ftt .ftt-lbl > .gl-q { vertical-align: 2px; margin-left: 6px; }
html[data-density="compact"] .ftt .ftt-lbl > .gl-q { margin-left: 5px; }

/* ── La bulle mise en forme (js/app.js : data-gl-titre) ── */
.iku-tip.iku-tip-gl { white-space: normal; max-width: 320px; }
.iku-tip-gl .iku-tip-ctx { white-space: pre-line; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--o12, rgba(255,255,255,.12)); }
.iku-tip-gl .iku-tip-t { display: block; font-weight: 700; font-size: 12px; margin-bottom: 2px; color: var(--tx1, inherit); }
.iku-tip-gl .iku-tip-d { white-space: pre-line; }
.iku-tip-gl .iku-tip-f {
    margin-top: 6px; padding: 4px 7px; border-radius: 6px; font-size: 11px; line-height: 1.4;
    background: var(--o6, rgba(255,255,255,.06)); color: var(--tx2, inherit); font-variant-numeric: tabular-nums;
}
html[data-theme="light"] .iku-tip-gl .iku-tip-ctx { border-bottom-color: rgba(15, 38, 56, .14); }
html[data-theme="light"] .iku-tip-gl .iku-tip-f { background: rgba(15, 38, 56, .06); }
html[data-papier] .iku-tip-gl .iku-tip-t { font-family: var(--pp-serif, Georgia, serif); }
html[data-papier] .iku-tip-gl .iku-tip-f { border-radius: 3px; }

/* ── La fenêtre ── */
.gls-voile { position: fixed; inset: 0; z-index: 10095; background: var(--bd72, rgba(3,12,18,.62)); }
html[data-theme="light"] .gls-voile { background: rgba(15, 30, 45, .38); }
.gls {
    position: fixed; z-index: 10096; top: 0; right: 0; bottom: 0;
    width: min(460px, 100vw); display: flex; flex-direction: column; overflow: hidden; outline: none;
    background: var(--surf-2, #102733); color: var(--tx1, #eafdff); font-family: var(--font-family);
    border-left: 1px solid color-mix(in srgb, var(--brand, #00B1CF) 24%, transparent);
    box-shadow: -24px 0 60px rgba(0,0,0,.45);
    animation: gls-entree .16s ease-out;
}
html[data-theme="light"] .gls { background: #fff; color: #10212b; box-shadow: -24px 0 60px rgba(30,41,59,.22); }
@keyframes gls-entree { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
html[data-motion="reduites"] .gls { animation: none; }
@media (prefers-reduced-motion: reduce) { .gls { animation: none; } }

.gls-tete { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 12px; padding: 16px 14px 12px 18px; border-bottom: 1px solid var(--o8, rgba(255,255,255,.08)); }
.gls-tete-ic { flex: 0 0 auto; width: 34px; height: 34px; 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)); }
.gls-tete-ic svg { width: 18px; height: 18px; }
.gls-tete-tx { flex: 1 1 auto; min-width: 0; }
.gls-titre { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; }
.gls-sous { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--mut1, #8aa0ad); }
html[data-theme="light"] .gls-sous { color: #4b5d68; }
.gls-x { flex: 0 0 auto; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px;
         border: 1px solid transparent; background: transparent; color: var(--mut1, #8aa0ad); cursor: pointer; }
.gls-x:hover { background: var(--o6, rgba(255,255,255,.06)); color: var(--tx1, #eafdff); }
html[data-theme="light"] .gls-x:hover { background: rgba(15, 38, 56, .06); color: #10212b; }
.gls-x svg { width: 16px; height: 16px; }

.gls-cherche { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin: 12px 18px 4px; padding: 0 12px; height: 40px;
               border-radius: 10px; border: 1px solid var(--o12, rgba(255,255,255,.12)); background: var(--o4, rgba(255,255,255,.04)); }
.gls-cherche:focus-within { border-color: color-mix(in srgb, var(--brand, #00B1CF) 60%, transparent); }
html[data-theme="light"] .gls-cherche { border-color: rgba(15, 38, 56, .18); background: #f7fafb; }
.gls-loupe { display: inline-flex; color: var(--mut1, #8aa0ad); }
.gls-loupe svg { width: 16px; height: 16px; }
.gls-champ { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; padding: 0;
             font: inherit; font-size: 16px; color: inherit; }   /* 16 px : iOS ne zoome pas sur le champ */
.gls .gls-champ:focus, .gls .gls-champ:focus-visible { outline: none; box-shadow: none; }
.gls-champ::placeholder { color: var(--mut1, #8aa0ad); opacity: 1; }
.gls-champ::-webkit-search-cancel-button { cursor: pointer; }

.gls-corps { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 18px 20px; }
.gls-grp { margin: 18px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut1, #8aa0ad); }
.gls-t { padding: 12px 0; border-bottom: 1px solid var(--o8, rgba(255,255,255,.08)); outline: none; }
html[data-theme="light"] .gls-t { border-bottom-color: rgba(15, 38, 56, .1); }
.gls-t:last-child { border-bottom: 0; }
.gls-t-fiche { padding: 14px 14px; border: 1px solid color-mix(in srgb, var(--brand, #00B1CF) 36%, transparent); border-radius: 12px;
               background: color-mix(in srgb, var(--brand, #00B1CF) 7%, transparent); }
.gls-t-fiche:focus-visible { outline: 2px solid var(--anneau-focus, var(--brand, #00B1CF)); outline-offset: 2px; }
.gls-n { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; line-height: 1.35; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.gls-n small { font-size: 12px; font-weight: 550; color: var(--mut1, #8aa0ad); }
html[data-theme="light"] .gls-n small { color: #4b5d68; }
.gls-n-btn { padding: 0; border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.gls-n-btn:hover { color: var(--brand-strong, var(--brand, #00B1CF)); text-decoration: underline; text-underline-offset: 3px; }
.gls-n-btn:focus-visible { outline: 2px solid var(--anneau-focus, var(--brand, #00B1CF)); outline-offset: 2px; border-radius: 3px; }
.gls-d { margin: 0; font-size: 13px; line-height: 1.55; color: var(--tx2, #c2cdd6); }
html[data-theme="light"] .gls-d { color: #24343e; }
.gls-f { margin: 8px 0 0; display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 8px;
         background: var(--o6, rgba(255,255,255,.06)); font-size: 12.5px; line-height: 1.45; }
html[data-theme="light"] .gls-f { background: rgba(15, 38, 56, .05); }
.gls-f-l, .gls-ou-l { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut1, #8aa0ad); }
html[data-theme="light"] :is(.gls-f-l, .gls-ou-l) { color: #4b5d68; }
.gls-f-v { font-variant-numeric: tabular-nums; }
.gls-ou { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; }
.gls-ou-tx { color: var(--tx2, #c2cdd6); }
html[data-theme="light"] .gls-ou-tx { color: #24343e; }
.gls-ou-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px; border-radius: 999px; cursor: pointer;
              font: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand-strong, var(--brand, #00B1CF));
              background: color-mix(in srgb, var(--brand, #00B1CF) 10%, transparent); border: 1px solid color-mix(in srgb, var(--brand, #00B1CF) 32%, transparent); }
.gls-ou-btn:hover { background: color-mix(in srgb, var(--brand, #00B1CF) 18%, transparent); }
.gls-ou-btn:focus-visible { outline: 2px solid var(--anneau-focus, var(--brand, #00B1CF)); outline-offset: 2px; }
html[data-theme="light"] .gls-ou-btn { color: #005f73; background: #e9f7fa; border-color: #9fd6e2; }
.gls-ou-btn svg { width: 13px; height: 13px; }
.gls-ou-etat { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 650; color: var(--st-amber, #fbbf24); }
html[data-theme="light"] .gls-ou-etat { color: #8a5a00; }
.gls-vide { margin: 18px 0; font-size: 13px; line-height: 1.5; color: var(--mut1, #8aa0ad); }

/* ── Mat et Papier : surfaces pleines du style, filets du thème ── */
html[data-style="mat"] .gls { background: var(--mt-carte) !important; border-color: var(--mt-trait) !important; box-shadow: -16px 0 40px rgba(0, 0, 0, .34) !important; }
html[data-style="mat"][data-theme="light"] .gls { box-shadow: -16px 0 40px rgba(15, 38, 56, .16) !important; }
html[data-style="mat"] :is(.gls-tete, .gls-t) { border-color: var(--mt-trait) !important; }
html[data-style="mat"] .gls-t-fiche { border-color: color-mix(in srgb, var(--brand, #00B1CF) 40%, var(--mt-trait)) !important; background: var(--mt-carte-2) !important; }
html[data-style="mat"] .gls-cherche { border-color: var(--mt-trait) !important; background: var(--mt-carte-2) !important; }
html[data-style="mat"] .gls-cherche:focus-within { border-color: color-mix(in srgb, var(--brand, #00B1CF) 60%, transparent) !important; }
html[data-papier] .gls { box-shadow: var(--pp-ombre-fen) !important; }
html[data-papier] :is(.gls-titre, .gls-n) { font-family: var(--pp-serif); }
html[data-papier] :is(.gls-t-fiche, .gls-cherche, .gls-f, .gls-tete-ic) { border-radius: 4px !important; }
html[data-papier] .gls-ou-btn { border-radius: 4px !important; }
html[data-papier] .gls-grp { font-family: var(--pp-serif); text-transform: none; letter-spacing: 0; font-size: 12.5px; }
html[data-papier] .gls-tete { border-bottom: 1px solid var(--pp-trait-fort) !important; }

/* ── Compact ── */
html[data-density="compact"] .gls-tete { padding: 12px 12px 10px 16px; }
html[data-density="compact"] .gls-cherche { height: 34px; margin: 10px 16px 2px; }
html[data-density="compact"] .gls-corps { padding: 4px 16px 16px; }
html[data-density="compact"] .gls-t { padding: 8px 0; }
html[data-density="compact"] .gls-d { font-size: 12.5px; line-height: 1.45; }
html[data-density="compact"] .gls-f { margin-top: 6px; padding: 5px 8px; }

/* ── Téléphone : plein écran ── */
@media (max-width: 640px) {
    .gls { left: 0; width: 100vw; height: 100vh; height: 100dvh; border-left: 0; box-shadow: none; animation: none; }
    .gls-tete { padding: 12px 8px 10px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
    .gls-x { width: 44px; height: 44px; }
    .gls-cherche { margin: 10px 16px 4px; height: 44px; }
    .gls-corps { padding: 6px 16px max(16px, env(safe-area-inset-bottom)); }
    .gls-ou-btn { min-height: 44px; }
    .gls-n-btn { min-height: 32px; }
}
