/* Konx socle : jetons et composants partagés par tous les produits.
   Une seule couleur primaire (--primary, remplaçable par le produit ou la marque blanche),
   des gris neutres, et deux couleurs sémantiques (danger, succès). Thèmes clair et sombre. */

@font-face { font-family: "Manrope"; src: url("/socle/polices/manrope.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --primary: #2563EB; --primary-text: #ffffff;
  --canvas: #F3F6FB; --panel: #ffffff; --text: #0B1F3A; --text-2: #33415C;
  --muted: #52607A; --faint: #8A97AD; --line: #E7EDF5; --line-2: #DCE4EF; --soft: #EEF3FA;
  --danger: #DC2626; --danger-doux: #FEECEC; --succes: #15803D; --succes-doux: #E8F6EC;
  --doux: color-mix(in srgb, var(--primary) 13%, var(--panel));
  --doux-text: color-mix(in srgb, var(--primary) 82%, var(--text));
  --shadow: 0 1px 2px rgba(11, 31, 58, .05);
  --shadow-lg: 0 16px 40px -14px rgba(11, 31, 58, .3), 0 2px 6px rgba(11, 31, 58, .06);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --r-lg: 18px; --r: 14px; --r-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #06111F; --panel: #0C1D35; --text: #EEF3FA; --text-2: #C9D4E5;
    --muted: #9FB1CC; --faint: #6B7D99; --line: #16294A; --line-2: #1E3558; --soft: #102540;
    --danger: #F87171; --danger-doux: #3A1620; --succes: #4ADE80; --succes-doux: #0F2E22;
    --doux: color-mix(in srgb, var(--primary) 24%, var(--panel));
    --doux-text: color-mix(in srgb, var(--primary) 45%, #ffffff);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 16px 40px -14px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #06111F; --panel: #0C1D35; --text: #EEF3FA; --text-2: #C9D4E5;
  --muted: #9FB1CC; --faint: #6B7D99; --line: #16294A; --line-2: #1E3558; --soft: #102540;
  --danger: #F87171; --danger-doux: #3A1620; --succes: #4ADE80; --succes-doux: #0F2E22;
  --doux: color-mix(in srgb, var(--primary) 24%, var(--panel));
  --doux-text: color-mix(in srgb, var(--primary) 45%, #ffffff);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 40px -14px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--text);
       font: 14px/1.5 Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--doux-text); }
code, .mono { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
code { background: var(--soft); padding: 2px 6px; border-radius: 6px; color: var(--text-2); word-break: break-all; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7;
        stroke-linecap: round; stroke-linejoin: round; }
.muet { color: var(--muted); }
.petit { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Marque ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; }
.brand-mark svg { width: 32px; height: 32px; }
.brand-mark img { width: 32px; height: 32px; object-fit: contain; }
.brand b { display: block; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.15;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span { font-size: 12px; color: var(--muted); }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { position: relative; width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line);
              border-radius: 22px; box-shadow: var(--shadow-lg); padding: 32px 28px 26px;
              animation: monter 360ms var(--ease-out) both; }
.login-card .brand { padding: 0 0 26px; }
.login-card h1 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 4px; font-weight: 650; }
.login-card > p { margin: 0 0 22px; color: var(--muted); }
.login-card label { display: block; font-size: 12.5px; color: var(--muted); margin: 14px 0 6px; }
.login-card .field { width: 100%; height: 42px; }
.login-card .btn { width: 100%; height: 42px; margin-top: 20px; }
.login-card .err, .login-card .err.muet { min-height: 20px; margin-top: 12px; font-size: 13px; color: var(--danger); font-weight: 500; }
.langue-login { position: absolute; top: 22px; right: 22px; }
@keyframes monter { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Segmenté (langue, thème) ---------- */
.seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
.seg button { border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 9px;
              border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--doux); color: var(--doux-text); }

/* ---------- Coquille ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app.sans-menu { grid-template-columns: minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
        background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; overflow-y: auto; z-index: 30; }
.nav-group { font-size: 12px; color: var(--faint); padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; cursor: pointer;
       padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 13.5px; font-weight: 500; text-align: left;
       text-decoration: none; transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out); }
.nav svg.i { width: 17px; height: 17px; color: var(--muted); }
.nav:hover { background: var(--soft); }
.nav[aria-current="page"] { background: var(--doux); color: var(--doux-text); font-weight: 700; }
.nav[aria-current="page"] svg.i { color: var(--doux-text); }
.nav:active { transform: scale(0.98); }
.side-pied { margin-top: auto; padding: 14px 10px 0; font-size: 11.5px; color: var(--faint); }

.main { min-width: 0; padding: 16px 28px 90px; }
.top { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-bottom: 18px; }
.top .burger { display: none; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; min-width: 0; }
.crumb b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; position: relative; }
.me { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px 0 4px; border-radius: 999px;
      border: 1px solid var(--line); background: var(--panel); cursor: pointer; max-width: 260px;
      transition: transform 160ms var(--ease-out); }
.me:active { transform: scale(0.97); }
.avatar { width: 32px; height: 32px; border-radius: 99px; background: var(--doux); color: var(--doux-text);
          display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.me .t { display: flex; flex-direction: column; line-height: 1.15; text-align: left; min-width: 0; }
.me b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-util { position: absolute; top: 48px; right: 0; width: 280px; background: var(--panel); border: 1px solid var(--line);
             border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 8px; z-index: 50;
             transform-origin: top right; animation: ouvrir 160ms var(--ease-out) both; }
@keyframes ouvrir { from { opacity: 0; transform: scale(.97); } }
.menu-util .item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; cursor: pointer;
                   padding: 8px 10px; border-radius: 10px; text-align: left; font-size: 13.5px; color: var(--text-2); }
.menu-util .item:hover { background: var(--soft); }
.menu-util .ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px;
                    font-size: 13px; color: var(--text-2); }
.menu-util hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-util .qui { padding: 8px 10px 10px; }
.menu-util .qui b { display: block; font-size: 13.5px; }
.menu-util .qui span { font-size: 12px; color: var(--muted); word-break: break-all; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
       border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer;
       font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--text);
       transition: transform 160ms var(--ease-out), background-color 150ms ease, opacity 150ms ease, color 150ms ease; }
.btn:hover { background: var(--soft); }
.btn svg.i { width: 16px; height: 16px; }
.btn.primaire { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.primaire:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line-2)); }
.btn.danger:hover { background: var(--danger-doux); }
.btn.arme { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.icone { width: 36px; padding: 0; }
.btn.sm.icone { width: 30px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
:is(.btn, .nav, .seg button, input, select, textarea, .me, .interrupteur, .item):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Champs ---------- */
.field, .champ input, .champ select, .champ textarea { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-sm);
       border: 1px solid var(--line-2); background: var(--panel); color: var(--text); outline: none;
       transition: border-color 150ms ease, box-shadow 150ms ease; }
.champ input[type="file"] { height: auto; padding: 6px 0; border: 0; background: none; box-shadow: none; }
.champ input[type="color"] { width: 72px; padding: 4px; cursor: pointer; }
.carte > .champ, .carte > .grille-form + .barre, .carte > .champ + .barre { margin-top: 16px; }
.champ textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.field:focus, .champ input:focus, .champ select:focus, .champ textarea:focus {
       border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ > label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.champ .aide { font-size: 12px; color: var(--faint); }
.champ.case { flex-direction: row; align-items: center; gap: 10px; }
.champ.case input { width: 18px; height: 18px; accent-color: var(--primary); }
.grille-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grille-form .large { grid-column: 1 / -1; }
select.field, .champ select { padding-right: 30px; }

.interrupteur { position: relative; width: 38px; height: 22px; border-radius: 99px; border: 0; background: var(--line-2);
                cursor: pointer; flex-shrink: 0; transition: background-color 160ms ease; }
.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 99px;
                       background: #fff; box-shadow: var(--shadow); transition: transform 180ms var(--ease-out); }
.interrupteur[aria-checked="true"] { background: var(--primary); }
.interrupteur[aria-checked="true"]::after { transform: translateX(16px); }
.interrupteur:disabled { opacity: .5; cursor: default; }

/* ---------- Pages ---------- */
.tete-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.tete-page h1 { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; margin: 0 0 4px; }
.tete-page p { margin: 0; color: var(--muted); max-width: 640px; }
.barre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.barre .field { width: auto; min-width: 160px; height: 36px; }
.barre input[type="search"].field { min-width: 240px; }
.carte h2.sous { font-size: 14px; margin: 20px 0 10px; }
.carte .tete-page { margin-bottom: 4px; }
.zone-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.zone-actions .barre { margin: 8px 0 0; }
.barre .espace { flex: 1; }

.carte { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; }
.carte + .carte { margin-top: 16px; }
.carte h2 { font-size: 16px; font-weight: 650; margin: 0 0 4px; letter-spacing: -0.01em; }
.carte > p { margin: 0 0 16px; color: var(--muted); }
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.chiffre { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.tableau-cadre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow-x: auto; }
table.tableau { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tableau th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 14px;
              border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); position: sticky; top: 0; }
.tableau td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover td { background: color-mix(in srgb, var(--soft) 60%, transparent); }
.tableau td.actions { text-align: right; white-space: nowrap; }
.tableau td.actions .btn + .btn { margin-left: 6px; }
.tableau .nombre { text-align: right; font-variant-numeric: tabular-nums; }
.tableau .centre { text-align: center; }
/* code court dans un tableau (action du journal d'audit) : jamais coupé lettre par lettre */
.tableau td.col-code { white-space: nowrap; }
code.code-ligne { word-break: normal; overflow-wrap: normal; white-space: nowrap; display: inline-block; max-width: 28ch;
                  overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px;
         font-size: 11.5px; font-weight: 600; background: var(--soft); color: var(--text-2); white-space: nowrap; }
.badge.primaire { background: var(--doux); color: var(--doux-text); }
.badge.succes { background: var(--succes-doux); color: var(--succes); }
.badge.danger { background: var(--danger-doux); color: var(--danger); }

.vide { text-align: center; padding: 48px 20px; color: var(--muted); }
.vide b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.vide svg.i { width: 28px; height: 28px; color: var(--faint); margin-bottom: 10px; }

.secret { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: var(--r-sm);
          background: var(--soft); border: 1px dashed var(--line-2); font: 15px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
          letter-spacing: .04em; word-break: break-all; }
.alerte { padding: 12px 14px; border-radius: var(--r-sm); background: var(--doux); color: var(--doux-text); font-size: 13px; }
.alerte.danger { background: var(--danger-doux); color: var(--danger); }

/* ---------- Matrice des rôles ---------- */
.matrice th.role { text-align: center; font-size: 11.5px; white-space: normal; min-width: 92px; }
.matrice td.groupe { font-size: 12px; font-weight: 600; color: var(--faint); background: var(--soft); }
.matrice td.cellule { text-align: center; }
.matrice input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.matrice input:disabled { cursor: default; }

/* ---------- Modale ---------- */
.modale-fond { position: fixed; inset: 0; background: rgba(6, 17, 31, .45); display: grid; place-items: center; padding: 16px;
               z-index: 80; animation: fondu 160ms ease both; }
@keyframes fondu { from { opacity: 0; } }
.modale { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel);
          border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px;
          animation: monter 220ms var(--ease-out) both; }
.modale h2 { margin: 0 0 14px; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.modale .pied { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 90;
          max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--canvas); padding: 11px 14px; border-radius: 12px; box-shadow: var(--shadow-lg);
         font-size: 13px; font-weight: 500; animation: monter 200ms var(--ease-out) both; }
.toast.danger { background: var(--danger); color: #fff; }
.toast.succes { background: var(--succes); color: #fff; }
:root[data-theme="dark"] .toast.succes { color: #06111F; }

.chargement { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Centre d'aide ---------- */
.aide-haut { height: 40px; padding: 0 12px; color: var(--muted); }
.aide-haut:hover { color: var(--text); }
.aide-contexte { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 13px; font-weight: 600;
                 color: var(--doux-text); text-decoration: none; }
.aide-contexte:hover { text-decoration: underline; text-underline-offset: 2px; }
.aide-contexte svg.i { width: 16px; height: 16px; }
.aide-grille { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.aide-grille .carte + .carte { margin-top: 0; }
.aide-liste { position: sticky; top: 16px; padding: 10px; max-height: calc(100vh - 32px); overflow-y: auto; }
.aide-liste .field { margin-bottom: 8px; }
.aide-lien, .aide-resultat { display: block; padding: 9px 10px; border-radius: 10px; color: var(--text-2); text-decoration: none;
                             font-size: 13.5px; font-weight: 500; transition: background-color 150ms ease; }
.aide-lien:hover, .aide-resultat:hover { background: var(--soft); }
.aide-lien[aria-current="page"] { background: var(--doux); color: var(--doux-text); font-weight: 700; }
.aide-resultat b { display: block; color: var(--text); font-weight: 600; }
.aide-resultat span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; overflow-wrap: anywhere; }
.aide-sous { font-size: 12px; color: var(--faint); padding: 14px 10px 4px; }
.aide-rien { padding: 6px 10px; margin: 0; }
.aide-lecteur { padding: 26px 28px 30px; min-width: 0; }
.aide-retour { display: none; margin: -6px 0 12px -8px; }
.aide-langue { margin: 0 0 16px; }
:is(.aide-lien, .aide-resultat, .aide-contexte, .md a, .md img[data-zoom]):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.md { max-width: 760px; font-size: 14.5px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md .t1 { font-size: 24px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 650; color: var(--text); margin: 0 0 14px; }
.md h3 { font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; color: var(--text); margin: 30px 0 8px; }
.md h4 { font-size: 15px; font-weight: 600; color: var(--text); margin: 22px 0 6px; }
.md h5 { font-size: 13.5px; font-weight: 600; color: var(--text); margin: 18px 0 6px; }
.md :is(h2, h3, h4, h5) { scroll-margin-top: 16px; }
.md p { margin: 0 0 12px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li > ul, .md li > ol { margin: 4px 0 0; }
.md b, .md strong { color: var(--text); font-weight: 600; }
.md a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.md kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--soft); }
.md figure { margin: 18px 0 20px; }
.md img { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); cursor: zoom-in; }
.md figure img { margin: 0 auto; }
.md figcaption, .md .md-fig .cap { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
.md .md-fig { display: block; margin: 12px 0; }
.md pre { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); overflow-x: auto;
          font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.md pre code { background: none; padding: 0; word-break: normal; font: inherit; }
.md blockquote { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.md blockquote p:last-child { margin-bottom: 0; }
.md .tbl { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.md table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); }
.md td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md tr:last-child td { border-bottom: 0; }
.md .ac { text-align: center; }
.md .ad { text-align: right; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.md .md-choix { margin: 0 0 16px; }
.md .md-choix-l { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; padding: 12px 14px;
                  border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.md .md-choix-l span { font-weight: 600; color: var(--text); }
.md .md-choix-l select { flex: 1 1 220px; max-width: 360px; }

.aide-zoom { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; background: rgba(6, 17, 31, .92);
             animation: fondu 160ms ease both; }
.aide-zoom-barre { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #fff; }
.aide-zoom-barre span { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aide-zoom-scene { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 12px; }
.aide-zoom-scene img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 8px; background: #fff; cursor: zoom-in; }
.aide-zoom.reelle .aide-zoom-scene { place-items: start; }
.aide-zoom.reelle .aide-zoom-scene img { max-width: none; max-height: none; cursor: zoom-out; }
html.aide-zoom-ouvert { overflow: hidden; }

/* ---------- Petits écrans ---------- */
.voile { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%);
          transition: transform 280ms var(--ease-drawer); box-shadow: var(--shadow-lg); }
  .app.menu-ouvert .side { transform: none; }
  .app.menu-ouvert .voile { display: block; position: fixed; inset: 0; background: rgba(6, 17, 31, .35); z-index: 25; }
  .top .burger { display: inline-flex; }
  .main { padding: 10px 16px 80px; }
  .me .t { display: none; }
  .me { padding: 0 4px; }
  .grille-form { grid-template-columns: minmax(0, 1fr); }
  .barre input[type="search"].field { min-width: 0; flex: 1; }
  .tete-page h1 { font-size: 21px; }
  .aide-grille { grid-template-columns: minmax(0, 1fr); }
  .aide-liste { position: static; max-height: none; }
  .aide.lecture .aide-liste, .aide.lecture > .tete-page, .aide:not(.lecture) .aide-lecteur { display: none; }
  .aide-retour { display: inline-flex; height: 40px; }
  .aide-lecteur { padding: 18px 16px 22px; }
  .aide-lien, .aide-resultat { padding: 12px 10px; }
  .md .t1 { font-size: 21px; }
}
@media (max-width: 560px) {
  .aide-haut { width: 40px; padding: 0; }
  .aide-haut span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ---------- pilotage (bandeau de nouvelle version, écrans bloquants) ---------- */
.pilotage-bandeau { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 16px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: var(--shadow-lg); font-size: 13.5px; }
.pilotage-bandeau .btn { height: 40px; }
.pilotage-ecran { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--canvas) 92%, transparent); }
.pilotage-ecran .carte { max-width: 440px; width: 100%; }
.pilotage-ecran .btn { min-height: 44px; }
.pilotage-onglets { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.pilotage-onglets button { flex: none; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--panel); color: var(--muted); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.pilotage-onglets button[aria-selected="true"] { background: var(--doux); color: var(--doux-text); border-color: transparent; }
.pilotage-regle { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 10px; }
.pilotage-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre-wrap;
  word-break: break-all; background: var(--soft); border-radius: var(--r-sm); padding: 10px; max-height: 320px; overflow: auto; }

/* entreprises du compte (0.5.0) */
.menu-util .entreprises { padding: 2px 0 6px; }
.menu-util .titre-entreprises { padding: 4px 12px; }
.menu-util .item.entreprise { align-items: flex-start; }
.menu-util .item.entreprise .t { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.menu-util .item.entreprise b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-util .item.entreprise small { color: var(--muted); font-size: 11.5px; }
.menu-util .item.entreprise[aria-checked="true"] { color: var(--primary); cursor: default; opacity: 1; }
.entreprise-haut { max-width: 220px; }
.entreprise-haut span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invitations { display: grid; gap: 10px; }
.invitations .carte { padding: 14px; display: grid; gap: 4px; }
@media (max-width: 640px) { .entreprise-haut span { display: none; } .entreprise-haut { width: 44px; min-height: 44px; padding: 0; } }
.invitations .carte + .carte { margin-top: 0; }
.acces-partages { margin-top: 28px; }
.acces-partages h2 { font-size: 16px; margin: 0 0 4px; }
