/* Gestion de crise cyber — direction artistique OnSec (onsec.fr), en version « outil » : marque reconnaissable,
   écrans denses lisibles. Thème : sombre par défaut ; clair ou « auto » (selon le système) au choix de l'utilisateur
   (html[data-theme]). Toutes les couleurs passent par les variables ci-dessous : aucune valeur de thème en JS.
   Palette (sombre) : fond « void » #050507, panneaux #0B0B10, texte « ink » #ECEEF4, secondaire #9499AB,
   paragraphe #C9CDD9, bordures ink 10–15 %. Rouge de marque #E10600 (#FF2E22 pour du texte sur fond sombre :
   #E10600 n'y atteint que ≈ 4:1) — il signale aussi le danger et la crise. Bleu de marque #1A3CFF (#8196FF sur
   fond sombre) : liens, sélection, focus. Actions principales en blanc sur noir (noir sur blanc en thème clair).
   Clair : fond #F4F5F8, cartes blanches, texte #0B0B10, secondaire #5C6070, accent #1A3CFF, rouge #E10600.
   Typographie : Archivo (axe de largeur, 108 %) pour les titres et grands chiffres, IBM Plex Sans pour le texte,
   Geist Mono pour les données techniques (horodatages, empreintes, identifiants).
   Arrondis : boutons en pilule, contrôles 8px, cartes 12px (14px pour la carte de connexion), fenêtres 16px.
   Performance : halos en dégradés fixes jamais animés ; flous limités à la carte de connexion et, sur ordinateur, à la
   navigation en verre (rail latéral, bulles de la barre haute) ; lueurs réservées aux petits points ; animations
   limitées à transform / opacity (seule la largeur du rail et de la recherche est animée). */
@font-face { font-family: "Archivo Variable"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url("/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo Variable"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Variable"; font-style: normal; font-display: swap; font-weight: 100 700;
  src: url("/fonts/ibm-plex-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans Variable"; font-style: normal; font-display: swap; font-weight: 100 700;
  src: url("/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* thème clair */
:root {
  color-scheme: light;
  --canvas: #eceef3; --bg: #f4f5f8; --main-bg: rgb(244 245 248 / .82); --panel: #ffffff; --soft: #eceef3; --hover: #f0f1f5;
  --line: rgb(11 11 16 / .09); --line2: rgb(11 11 16 / .16);
  /* texte (contraste AA sur --bg et --panel) */
  --tx: #0b0b10; --tx-p: #2a2d38; --txm: #5c6070; --txl: #6a6e7e;
  /* marque OnSec : bleu (liens, sélection, focus) et rouge (marque, danger) */
  --brand: #1a3cff; --brand-hover: #1430d6; --brand2: #8e63ff; --brand-bg: #ebefff; --brand-tx: #1a3cff; --brand-line: #c2ccff;
  --red: #e10600; --red-hover: #c80500; --red-tx: #e10600; --blue: #1a3cff;
  /* encre : boutons principaux (noir sur blanc) */
  --ink: #0b0b10; --ink-hover: #24242c; --on-ink: #ffffff;
  --acc: var(--brand); --acc2: var(--brand-tx); --accbg: #ebefff; --accline: rgb(11 11 16 / .34);
  --focus: #1a3cff;
  --side: var(--ink); --side2: var(--canvas); --sidetx: #3a3e4c;
  /* point lumineux des surtitres et titres de page (sans lueur en clair) */
  --dot-glow: none;
  /* halos de fond : très discrets dans l'outil, marqués sur la connexion */
  --halos: radial-gradient(60% 50% at 12% 78%, rgb(225 6 0 / .05), transparent 70%), radial-gradient(55% 50% at 88% 20%, rgb(26 60 255 / .06), transparent 70%);
  --halos-hero: radial-gradient(60% 50% at 12% 78%, rgb(225 6 0 / .16), transparent 70%), radial-gradient(55% 50% at 88% 20%, rgb(26 60 255 / .16), transparent 70%);
  --glass: rgb(255 255 255 / .78); --glass-line: rgb(11 11 16 / .1);
  /* verre de la navigation (ordinateur) : rail latéral et bulles de la barre haute */
  --glass-bg:
    linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.25) 45%, rgba(255,255,255,.15)),
    radial-gradient(120% 40% at 0% 0%, rgba(225,6,0,.08), transparent 70%),
    radial-gradient(120% 45% at 100% 100%, rgba(26,60,255,.09), transparent 70%),
    rgba(255,255,255,.30);
  --glass-edge: rgba(11,11,16,.10); --glass-hi: rgba(255,255,255,.95); --glass-glow: rgba(255,255,255,.04);
  --glass-shadow: 0 18px 44px -18px rgba(11,11,16,.28);
  --glass-item: rgba(11,11,16,.06); --glass-bubble-fill: rgba(255,255,255,.55);
  /* teintes des rubriques (icônes de navigation, bandeaux d'indicateurs) */
  --c-blue: #1a3cff; --c-teal: #0e9fb0; --c-violet: #7c3aed; --c-amber: #d97706; --c-rose: #e11d48; --c-green: #16a34a; --c-slate: #64748b;
  /* statuts : le rouge de marque porte l'erreur ; succès, avertissement et sévérités restent distincts */
  --ok: #2e7d4f; --part: #d4931c; --nc: #e10600; --nc-strong: #a80500; --na: #8b8fa0; --info: #1a3cff; --warn: #a86412;
  --ok-bg: #e8f2eb; --part-bg: #fbf0da; --nc-bg: #fdeceb; --info-bg: #ebefff; --na-bg: #eceef3;
  --ok-tx: #1f5c39; --part-tx: #7a4d0c; --nc-tx: #b00500; --info-tx: #1430d6; --na-tx: #4a4e5c;
  --ok-line: #c3dccb; --part-line: #ecd5a2; --nc-line: #f6c3c0; --info-line: #c2ccff;
  --signal: #e10600;
  /* texte sur les couleurs claires venant du catalogue (niveaux de risque) : identique dans les deux thèmes */
  --on-data: #1c1c1a;
  /* forme */
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px; --radius-lg: 16px; --radius-pill: 999px;
  --shade: 11 11 16;
  --shadow: 0 1px 2px rgb(var(--shade) / .05), 0 1px 1px rgb(var(--shade) / .03);
  --shadow-pop: 0 1px 2px rgb(var(--shade) / .06), 0 12px 32px -8px rgb(var(--shade) / .2);
  --scrim: rgb(var(--shade) / .4);
  --font: "IBM Plex Sans Variable", "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Archivo Variable", "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display-stretch: 108%;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --z-side: 50; --z-modal: 1000; --z-toast: 2000;
}
/* thème sombre (« void ») : par défaut, choisi explicitement, ou « auto » quand le système est en sombre.
   Les deux blocs ci-dessous doivent rester identiques. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #050507; --bg: #08080c; --main-bg: rgb(8 8 12 / .5); --panel: #0b0b10; --soft: #15151c; --hover: #121219;
  --line: rgb(236 238 244 / .1); --line2: rgb(236 238 244 / .15);
  --tx: #eceef4; --tx-p: #c9cdd9; --txm: #9499ab; --txl: #858a9c;
  --brand: #8196ff; --brand-hover: #9daeff; --brand2: #8e63ff; --brand-bg: rgb(129 150 255 / .14); --brand-tx: #a9b7ff; --brand-line: rgb(129 150 255 / .4);
  --red: #e10600; --red-tx: #ff2e22; --blue: #8196ff;
  --ink: #eceef4; --ink-hover: #ffffff; --on-ink: #050507;
  --accbg: rgb(129 150 255 / .12); --accline: rgb(236 238 244 / .34); --sidetx: #c9cdd9;
  --focus: #8196ff;
  --dot-glow: 0 0 12px currentColor;
  --halos: radial-gradient(60% 50% at 12% 78%, rgb(225 6 0 / .12), transparent 70%), radial-gradient(55% 50% at 88% 20%, rgb(26 60 255 / .11), transparent 70%);
  --halos-hero: radial-gradient(60% 50% at 12% 78%, rgb(225 6 0 / .42), transparent 70%), radial-gradient(55% 50% at 88% 20%, rgb(26 60 255 / .38), transparent 70%);
  --glass: rgb(9 9 13 / .78); --glass-line: rgb(236 238 244 / .15);
  --glass-bg:
    linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.03) 38%, rgba(255,255,255,0) 60%),
    radial-gradient(120% 40% at 0% 0%, rgba(225,6,0,.20), transparent 70%),
    radial-gradient(120% 45% at 100% 100%, rgba(26,60,255,.22), transparent 70%),
    rgba(14,14,22,.34);
  --glass-edge: rgba(255,255,255,.16); --glass-hi: rgba(255,255,255,.28); --glass-glow: rgba(255,255,255,.04);
  --glass-shadow: 0 24px 56px -14px rgba(0,0,0,.7);
  --glass-item: rgba(255,255,255,.11); --glass-bubble-fill: rgba(14,14,22,.5);
  --c-blue: #8196ff; --c-teal: #33c2d1; --c-violet: #a78bfa; --c-amber: #f0b44c; --c-rose: #fb7185; --c-green: #4ade80; --c-slate: #94a3b8;
  --ok: #4fae74; --part: #e0a63a; --nc: #ff2e22; --nc-strong: #ff5a50; --na: #858a9c; --info: #8196ff; --warn: #e0a63a;
  --ok-bg: rgb(79 174 116 / .14); --part-bg: rgb(224 166 58 / .14); --nc-bg: rgb(255 46 34 / .12); --info-bg: rgb(129 150 255 / .13); --na-bg: #16161d;
  --ok-tx: #8fd3a8; --part-tx: #f0c677; --nc-tx: #ff6b62; --info-tx: #b4c0ff; --na-tx: #c9cdd9;
  --ok-line: rgb(79 174 116 / .35); --part-line: rgb(224 166 58 / .35); --nc-line: rgb(255 46 34 / .38); --info-line: rgb(129 150 255 / .35);
  --signal: #ff2e22;
  --shade: 0 0 0;
  --shadow: none;
  --shadow-pop: 0 0 0 1px rgb(236 238 244 / .12), 0 16px 40px -8px rgb(0 0 0 / .7);
  --scrim: rgb(5 5 7 / .74);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --canvas: #050507; --bg: #08080c; --main-bg: rgb(8 8 12 / .5); --panel: #0b0b10; --soft: #15151c; --hover: #121219;
    --line: rgb(236 238 244 / .1); --line2: rgb(236 238 244 / .15);
    --tx: #eceef4; --tx-p: #c9cdd9; --txm: #9499ab; --txl: #858a9c;
    --brand: #8196ff; --brand-hover: #9daeff; --brand2: #8e63ff; --brand-bg: rgb(129 150 255 / .14); --brand-tx: #a9b7ff; --brand-line: rgb(129 150 255 / .4);
    --red: #e10600; --red-tx: #ff2e22; --blue: #8196ff;
    --ink: #eceef4; --ink-hover: #ffffff; --on-ink: #050507;
    --accbg: rgb(129 150 255 / .12); --accline: rgb(236 238 244 / .34); --sidetx: #c9cdd9;
    --focus: #8196ff;
    --dot-glow: 0 0 12px currentColor;
    --halos: radial-gradient(60% 50% at 12% 78%, rgb(225 6 0 / .12), transparent 70%), radial-gradient(55% 50% at 88% 20%, rgb(26 60 255 / .11), transparent 70%);
    --halos-hero: radial-gradient(60% 50% at 12% 78%, rgb(225 6 0 / .42), transparent 70%), radial-gradient(55% 50% at 88% 20%, rgb(26 60 255 / .38), transparent 70%);
    --glass: rgb(9 9 13 / .78); --glass-line: rgb(236 238 244 / .15);
    --glass-bg:
      linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.03) 38%, rgba(255,255,255,0) 60%),
      radial-gradient(120% 40% at 0% 0%, rgba(225,6,0,.20), transparent 70%),
      radial-gradient(120% 45% at 100% 100%, rgba(26,60,255,.22), transparent 70%),
      rgba(14,14,22,.34);
    --glass-edge: rgba(255,255,255,.16); --glass-hi: rgba(255,255,255,.28); --glass-glow: rgba(255,255,255,.04);
    --glass-shadow: 0 24px 56px -14px rgba(0,0,0,.7);
    --glass-item: rgba(255,255,255,.11); --glass-bubble-fill: rgba(14,14,22,.5);
    --c-blue: #8196ff; --c-teal: #33c2d1; --c-violet: #a78bfa; --c-amber: #f0b44c; --c-rose: #fb7185; --c-green: #4ade80; --c-slate: #94a3b8;
    --ok: #4fae74; --part: #e0a63a; --nc: #ff2e22; --nc-strong: #ff5a50; --na: #858a9c; --info: #8196ff; --warn: #e0a63a;
    --ok-bg: rgb(79 174 116 / .14); --part-bg: rgb(224 166 58 / .14); --nc-bg: rgb(255 46 34 / .12); --info-bg: rgb(129 150 255 / .13); --na-bg: #16161d;
    --ok-tx: #8fd3a8; --part-tx: #f0c677; --nc-tx: #ff6b62; --info-tx: #b4c0ff; --na-tx: #c9cdd9;
    --ok-line: rgb(79 174 116 / .35); --part-line: rgb(224 166 58 / .35); --nc-line: rgb(255 46 34 / .38); --info-line: rgb(129 150 255 / .35);
    --signal: #ff2e22;
    --shade: 0 0 0;
    --shadow: none;
    --shadow-pop: 0 0 0 1px rgb(236 238 244 / .12), 0 16px 40px -8px rgb(0 0 0 / .7);
    --scrim: rgb(5 5 7 / .74);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.55 var(--font); color: var(--tx); background: var(--canvas); -webkit-font-smoothing: antialiased; }
/* halos de marque : calque fixe peint une fois, jamais animé, sans filter: blur (le flou est dans le dégradé) */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--halos); }
body:has(.auth-wrap)::before { background: var(--halos-hero); }
::selection { background: var(--brand); color: var(--on-ink); }
a { color: var(--tx); text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 3px; transition: text-decoration-color .15s ease; }
a:hover { text-decoration-color: var(--brand); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
/* titres et grands chiffres : Archivo élargi ; gros titres fins, une partie mise en avant en 500 (<b>, <strong>) */
h1, h2, .display { font-family: var(--display); font-stretch: var(--display-stretch); }
h1 { font-size: 1.75rem; font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; }
h1 b, h1 strong, .display b, .display strong { font-weight: 500; }
h2 { font-weight: 500; letter-spacing: -0.005em; }
h2 { font-size: 1.02rem; } h3 { font-size: .95rem; } h4 { font-size: .86rem; }
p { margin: 0 0 .7em; text-wrap: pretty; }
code, .mono { font-family: var(--mono); font-size: .84em; }
.muted { color: var(--txm); } .small { font-size: .82rem; } .tiny { font-size: .72rem; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
/* point lumineux de 6 px (surtitres, titres de page) : rouge ou bleu, lueur seulement en sombre */
.dot-l { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; color: var(--red-tx); background: currentColor; box-shadow: var(--dot-glow); vertical-align: .2em; }
.dot-l.blue { color: var(--blue); }
/* logo OnSec : anneau et « on » en currentColor, point et « sec » en rouge de marque */
.onsec-logo { display: block; height: 1em; width: auto; overflow: visible; }
svg.i { flex-shrink: 0; display: inline-block; vertical-align: -0.2em; width: 1.15em; height: 1.15em; }
#side svg.i, #top svg.i { width: 18px; height: 18px; }
.btn svg.i { width: 16px; height: 16px; margin-left: -2px; color: inherit; }
.btn-sm svg.i { width: 14px; height: 14px; }
svg.i.flip { transform: scaleX(-1); }
.done-ic { display: inline-grid; color: var(--ok); }
.btn-sm:has(> svg.i:only-child) { padding: 0 7px; }

/* ---------- coquille ---------- */
#app { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); height: 100vh; height: 100dvh; }
#app.no-side { grid-template-columns: minmax(0, 1fr); }
#app.no-side #side, #app.no-side #top { display: none; }
#app.no-side #main { grid-column: 1; grid-row: 1 / -1; margin: 0; border: 0; border-radius: 0; padding: 0; background: var(--main-bg); }
#app.no-side #main:has(> .auth-wrap) { background: transparent; }

#side { grid-row: 1 / -1; grid-column: 1; background: transparent; color: var(--sidetx); overflow-y: auto; padding: 14px 12px 32px; scrollbar-width: thin; }
#side .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 8px 10px 18px; color: var(--tx); text-decoration: none; }
#side .brand .onsec-logo { font-size: 22px; }
#side .brand-n { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; font-size: .78rem; color: var(--txm); }
#side .grp { display: flex; align-items: center; gap: 8px; font-size: .68rem; color: var(--txm); margin: 20px 10px 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
#side a.nav { display: flex; align-items: center; gap: 10px; padding: 6px 10px; min-height: 36px; border-radius: var(--radius-sm); color: var(--sidetx); font-size: .875rem; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
/* chaque rubrique a sa teinte (--c), pour se repérer d'un coup d'œil */
#side a.nav .nav-ic { width: 26px; height: 26px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; flex-shrink: 0; color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 12%, transparent); transition: background-color .15s ease, color .15s ease; }
#side a.nav .nav-ic svg.i { width: 16px; height: 16px; }
#side a.nav .nav-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#side a.nav:hover { background: rgb(var(--shade) / .05); color: var(--tx); }
#side a.nav.on { background: var(--panel); color: var(--tx); font-weight: 500; box-shadow: 0 0 0 1px var(--line); }
#side a.nav.on .nav-ic { background: var(--c, var(--brand)); color: var(--on-ink); }
#side .count { margin-left: auto; font: 500 .72rem/1 var(--mono); color: var(--txl); font-variant-numeric: tabular-nums; }
#side .count.err { color: var(--nc); } #side .count.warn { color: var(--warn); }
#side .sub { padding-left: 14px; }
#side .grp-l { display: inline-flex; align-items: center; gap: 8px; }
/* tête de navigation et pied du rail : sur mobile (tiroir), présentation d'origine */
#side .brand-full { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
#side .brand-mono, #side .brand-rule, #side .rail-pin, #rail-space { display: none; }
#top .top-group { display: contents; }
#top .crumb-title { display: contents; }
#top .lvl-short, #top .sync-q { display: none; }

#top { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 6px; padding: 0 16px 0 20px; background: transparent; color: var(--tx); min-width: 0; }
#top .crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; font-size: .86rem; color: var(--txm); }
#top .crumbs a { text-decoration: none; color: var(--txm); }
#top .crumbs a:hover { color: var(--tx); }
#top .crumbs .crumb-cur { color: var(--tx); font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
#top .crumbs .crumb-sep { color: var(--line2); }
#top .crumbs .crumb-meta { color: var(--txl); overflow: hidden; text-overflow: ellipsis; padding-left: 8px; border-left: 1px solid var(--line2); }
#top .tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; padding: 2px 7px; border-radius: var(--radius-xs); background: var(--panel); border: 1px solid var(--line); color: var(--txm); }
#top .tag svg.i { width: 12px; height: 12px; }
/* le point traduit un état réel (enregistrement) */
#top .sync { font-size: .76rem; color: var(--txm); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
#top .sync::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line2); }
#top .sync.saving::before, #top .sync.pending::before { background: var(--part); animation: pulse 1.2s ease-in-out infinite; }
#top .sync.saved::before { background: var(--ok); }
#top .sync.offline::before { background: var(--nc); }
@keyframes pulse { 50% { opacity: .35; } }
#top .btn-top { display: inline-flex; align-items: center; gap: 7px; height: 34px; background: transparent; border: 0; color: var(--txm); border-radius: var(--radius-sm); padding: 0 10px; font: inherit; font-size: .82rem; font-weight: 500; cursor: pointer; text-decoration: none; transition: background-color .15s ease, color .15s ease, transform .16s var(--ease-out); }
#top .btn-top:hover { background: rgb(var(--shade) / .06); color: var(--tx); }
#top .btn-top:active { transform: scale(.97); }
#top .btn-top.icon-only { padding: 0 8px; }
/* sélecteur de langue FR | EN */
.lang-sw { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--panel); flex-shrink: 0; }
.lang-sw button { min-width: 34px; height: 28px; padding: 0 9px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--txm); font: inherit; font-size: .78rem; font-weight: 600; letter-spacing: .02em; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.lang-sw button:hover { color: var(--tx); }
.lang-sw button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.lang-sw button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.theme-sw button { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; }
.theme-sw button svg.i { width: 14px; height: 14px; }
.auth-main { position: relative; }
.auth-lang { position: absolute; top: 20px; right: 24px; }
#top .menu-btn { display: none; padding: 0 8px; margin-left: -8px; }
#top .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line2); color: var(--tx); display: inline-grid; place-items: center; font-size: .66rem; font-weight: 600; letter-spacing: .02em; }
#top .user { color: var(--tx); }

#main { grid-column: 2; grid-row: 2; overflow-y: auto; min-width: 0; background: var(--main-bg); border: 1px solid var(--line); border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius-lg); padding: 36px 44px 80px; scrollbar-gutter: stable; }
#main:focus { outline: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 260px; }
.page-head h1 { margin: 0; }
.page-head h1::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 12px 0 1px; vertical-align: .22em; border-radius: 50%; color: var(--red-tx); background: currentColor; box-shadow: var(--dot-glow); }
.page-head .sub { color: var(--txm); margin-top: 8px; max-width: 68ch; font-size: .9rem; }

/* ---------- composants ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack > * + * { margin-top: 12px; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; border: 1px solid var(--line2); background: transparent; color: var(--tx); border-radius: var(--radius-pill); padding: 0 15px; font: inherit; font-size: .84rem; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: 0 1px 1px rgb(var(--shade) / .04);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--ease-out); }
.btn:hover { background: var(--hover); border-color: var(--accline); text-decoration: none; }
.btn:focus-visible { border-radius: var(--radius-pill); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* action principale : ink plein (blanc sur noir en sombre, noir sur blanc en clair) */
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); box-shadow: none; }
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: var(--on-ink); }
/* danger : rouge de marque plein, texte blanc (≥ 4,5:1) */
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; box-shadow: none; }
.btn-danger:hover { background: var(--red-hover); border-color: var(--red-hover); color: #fff; }
.btn-sm { height: 28px; padding: 0 11px; font-size: .78rem; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgb(var(--shade) / .05); border-color: transparent; }
.icon-btn { border: none; background: transparent; cursor: pointer; font-size: 1rem; color: var(--txm); padding: 4px 7px; border-radius: var(--radius-xs); transition: background-color .15s ease, color .15s ease; }
.icon-btn:hover { background: var(--soft); color: var(--tx); }

.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 7px 11px; min-height: 36px; font: inherit; font-size: .875rem; color: var(--tx); background: var(--panel); transition: border-color .15s ease, box-shadow .15s ease; }
.input::placeholder { color: var(--txl); }
select.input { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256' fill='%2373736d'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select.input[multiple] { background-image: none; padding-right: 11px; }
textarea.input { resize: vertical; min-height: 76px; line-height: 1.5; }
.input:hover { border-color: var(--accline); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: none; }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-radius: var(--radius-sm); }
.input[readonly], .input:disabled { background: var(--soft); color: var(--txm); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 15px; height: 15px; }
.lbl { display: block; font-size: .78rem; font-weight: 500; color: var(--txm); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.help { font-size: .76rem; color: var(--txl); margin-top: 5px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: .86rem; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: var(--radius-xs); font-size: .72rem; font-weight: 500; background: var(--soft); color: var(--txm); white-space: nowrap; line-height: 1.45; }
.badge.ok { background: var(--ok-bg); color: var(--ok-tx); } .badge.part { background: var(--part-bg); color: var(--part-tx); }
.badge.nc { background: var(--nc-bg); color: var(--nc-tx); } .badge.na { background: var(--na-bg); color: var(--na-tx); }
.badge.acc { background: var(--ink); color: var(--on-ink); } .badge.info { background: var(--info-bg); color: var(--info-tx); }
.badge.err { background: var(--nc); color: var(--on-ink); } .badge.warn { background: var(--part); color: var(--on-ink); }
.pill { display: inline-block; padding: 2px 8px; border-radius: var(--radius-xs); font-size: .74rem; font-weight: 500; color: var(--on-ink); }
.pill.pill-data { color: var(--on-data); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border: 1px solid var(--line2); border-radius: var(--radius-xs); font-size: .78rem; background: var(--panel); max-width: 100%; }
.chip .x { cursor: pointer; color: var(--txl); border: 0; background: none; padding: 0 2px; font-size: .9rem; }
.chip .x:hover { color: var(--nc); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; background: var(--panel); color: var(--txm); font-size: .74rem; font-weight: 500; padding: 10px 12px; position: sticky; top: 0; z-index: 1; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tr:first-child td { border-top: 0; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable a { color: inherit; text-decoration: none; } .tbl tr.clickable:hover td { background: var(--hover); }
.tbl tr.sel td { background: var(--accbg); }
.tbl input.input, .tbl select.input { padding: 4px 8px; min-height: 30px; font-size: .82rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin-bottom: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi { background: var(--panel); padding: 16px 20px 18px; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); min-width: 0; }
.kpi a { text-decoration: none; color: inherit; display: block; }
.kpi a:hover .v { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
/* la teinte de rubrique reste sur le bandeau : la valeur garde la couleur du texte (une couleur de statut ne s'applique que si elle a un sens) */
.kpi .v { font-family: var(--display); font-stretch: var(--display-stretch); font-size: 1.85rem; font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--tx); }
.kpi { border-top: 3px solid var(--kc, transparent) !important; }
.kpis .kpi:nth-child(6n+1), .grid > .kpi:nth-child(6n+1) { --kc: var(--c-blue); }
.kpis .kpi:nth-child(6n+2), .grid > .kpi:nth-child(6n+2) { --kc: var(--c-teal); }
.kpis .kpi:nth-child(6n+3), .grid > .kpi:nth-child(6n+3) { --kc: var(--c-violet); }
.kpis .kpi:nth-child(6n+4), .grid > .kpi:nth-child(6n+4) { --kc: var(--c-amber); }
.kpis .kpi:nth-child(6n+5), .grid > .kpi:nth-child(6n+5) { --kc: var(--c-green); }
.kpis .kpi:nth-child(6n+6), .grid > .kpi:nth-child(6n+6) { --kc: var(--c-rose); }
.kpi .l { font-size: .78rem; color: var(--txm); margin-top: 6px; }
.grid > .kpi, .grid-4 > .kpi { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; display: flex; gap: 1px; }
.bar > span { display: block; height: 100%; }
.progress { height: 4px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 9px 12px; font-weight: 500; font-size: .86rem; color: var(--txm); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; transition: color .15s ease, border-color .15s ease; }
.tab:hover { color: var(--tx); }
.tab.on { color: var(--brand-tx); border-bottom-color: var(--brand); }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--soft); border-radius: var(--radius-sm); }
.seg button { border: 0; background: transparent; padding: 4px 10px; height: 28px; font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer; color: var(--txm); border-radius: var(--radius-xs); transition: background-color .15s ease, color .15s ease; }
.seg button:hover { color: var(--tx); }
.seg button.on { background: var(--panel); color: var(--tx); box-shadow: 0 1px 2px rgb(var(--shade) / .1), 0 0 0 1px var(--line); }

/* ---------- évaluation ---------- */
.audit-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.req-list { max-height: calc(100vh - 230px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); scrollbar-width: thin; }
.req-sec { padding: 10px 14px; background: color-mix(in srgb, var(--brand-bg) 70%, var(--panel)); font-weight: 600; font-size: .8rem; color: var(--tx); position: sticky; top: 0; z-index: 1; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; cursor: pointer; user-select: none; transition: background-color .15s ease; }
.req-sec:hover { background: color-mix(in srgb, var(--brand-bg) 100%, var(--panel)); }
.req-sec:first-child { border-top: 0; }
.req-sec .caret { color: var(--brand); display: inline-grid; place-items: center; width: 12px; transition: transform .15s ease; }
.req-sec .caret svg.i { width: 12px; height: 12px; }
.req-sec.open .caret { transform: rotate(90deg); }
.req-sec .sec-n { font: 500 .7rem/1 var(--mono); color: var(--txm); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 3px 7px; }
.list-tools { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.list-tools + .req-sec { border-top: 0; }
.req-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; font-size: .84rem; transition: background-color .12s ease; }
.req-item:hover { background: var(--hover); }
.req-item.on { background: var(--accbg); box-shadow: inset 3px 0 0 var(--brand); }
.req-item .ref { font-family: var(--mono); font-size: .74rem; color: var(--txm); min-width: 54px; padding-top: 1px; }
.req-item .t { flex: 1; min-width: 0; }
.req-item .t .d { color: var(--txm); font-size: .76rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* pastille = résultat réel de l'exigence */
.dotr { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; border: 1.5px solid transparent; }
.detail { position: sticky; top: 0; }
.req-text { white-space: pre-wrap; background: var(--soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .86rem; line-height: 1.6; max-height: 280px; overflow-y: auto; }
.res-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.res-btn { border: 1px solid var(--line2); background: var(--panel); border-radius: var(--radius-sm); padding: 0 12px; height: 34px; font: inherit; font-weight: 500; font-size: .82rem; cursor: pointer; color: var(--txm); transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--ease-out); }
.res-btn:hover { border-color: var(--txm); color: var(--tx); }
.res-btn:active { transform: scale(.97); }
.res-btn.on { color: var(--on-ink); }
.res-btn[data-v=compliant].on { background: var(--ok); border-color: var(--ok); }
.res-btn[data-v=partially_compliant].on { background: var(--part); border-color: var(--part); }
.res-btn[data-v=non_compliant].on { background: var(--nc); border-color: var(--nc); }
.res-btn[data-v=not_applicable].on { background: var(--na); border-color: var(--na); }
.score-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.score-btn { min-width: 34px; height: 30px; border: 1px solid var(--line2); background: var(--panel); color: var(--tx); border-radius: var(--radius-sm); padding: 0 8px; font: inherit; font-family: var(--mono); font-size: .8rem; font-weight: 500; cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .16s var(--ease-out); }
.score-btn:hover { border-color: var(--txm); }
.score-btn:active { transform: scale(.95); }
.score-btn.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chk-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); font-size: .84rem; }
.chk-row:first-child { border-top: 0; }
.chk-row .t { flex: 1; }
.chk-btns { display: flex; gap: 3px; flex-shrink: 0; }
.chk-btns button { border: 1px solid var(--line2); background: var(--panel); border-radius: var(--radius-xs); font: inherit; font-size: .7rem; font-weight: 500; padding: 2px 7px; cursor: pointer; color: var(--txm); transition: background-color .12s ease, color .12s ease; }
.chk-btns button:hover { color: var(--tx); border-color: var(--txm); }
.chk-btns button.on[data-v=ok] { background: var(--ok); color: var(--on-ink); border-color: var(--ok); }
.chk-btns button.on[data-v=partial] { background: var(--part); color: var(--on-ink); border-color: var(--part); }
.chk-btns button.on[data-v=missing] { background: var(--nc); color: var(--on-ink); border-color: var(--nc); }
.chk-btns button.on[data-v=na] { background: var(--na); color: var(--on-ink); border-color: var(--na); }
.hint { background: var(--brand-bg); border-left: 3px solid var(--brand); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 10px 14px; font-size: .82rem; }
.notice { border-radius: var(--radius-sm); padding: 10px 14px; font-size: .84rem; border: 1px solid; }
.notice.warn { background: var(--part-bg); border-color: var(--part-line); color: var(--part-tx); }
.notice.err { background: var(--nc-bg); border-color: var(--nc-line); color: var(--nc-tx); }
.notice.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info-tx); }
.notice.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-tx); }
.notice a { color: inherit; }
details.more > summary { cursor: pointer; font-weight: 500; font-size: .82rem; color: var(--txm); margin: 8px 0; }
details.more > summary:hover { color: var(--tx); }
ul.compact { margin: 4px 0; padding-left: 18px; } ul.compact li { margin: 3px 0; }

/* ---------- entretien (mode flash) ---------- */
.flash { max-width: 920px; margin: 0 auto; }
.flash .card { padding: 32px 36px; }
.flash .big-ref { font-family: var(--mono); color: var(--txm); font-weight: 500; }
.flash h2 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.kbd { display: inline-block; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: var(--radius-xs); padding: 0 5px; font-size: .72rem; font-family: var(--mono); background: var(--panel); color: var(--txm); }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; }
.kcol { background: var(--soft); border-radius: var(--radius); padding: 10px; min-height: 220px; }
.kcol h4 { display: flex; justify-content: space-between; margin: 2px 4px 10px; font-weight: 500; color: var(--txm); }
.kcol.drop { outline: 1.5px dashed var(--tx); outline-offset: -2px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; cursor: grab; font-size: .82rem; box-shadow: var(--shadow); }
.kcard:hover { border-color: var(--line2); }
.kcard:active { cursor: grabbing; }

/* ---------- risques ---------- */
.heat { border-collapse: separate; border-spacing: 3px; }
.heat td { width: 46px; height: 38px; text-align: center; font-weight: 600; border-radius: var(--radius-xs); color: var(--on-data); font-size: .84rem; font-variant-numeric: tabular-nums; }
.heat td.no-lv { color: var(--tx); }
.heat th { font-size: .68rem; color: var(--txm); font-weight: 500; padding: 2px 4px; max-width: 90px; }

/* ---------- connexion ---------- */
/* rendu du site vitrine : fond void à halos marqués (body::before), logo, accroche fine en Archivo, carte en verre */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(400px, .85fr); background: transparent; }
.auth-aside { position: relative; color: var(--tx); padding: 44px 56px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-aside .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: var(--tx); }
.auth-aside .brand .onsec-logo { font-size: 30px; }
.auth-aside .brand-n { font-size: .84rem; color: var(--txm); letter-spacing: .01em; }
.auth-aside .kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: .74rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--txm); }
.auth-aside .statement { font-family: var(--display); font-stretch: 110%; font-size: clamp(2.3rem, 3.9vw, 3.6rem); font-weight: 300; line-height: 1.05; letter-spacing: -0.025em; margin: 0; max-width: 17ch; color: var(--tx); text-wrap: balance; }
.auth-aside .statement b { display: block; font-weight: 500; }
.auth-aside .lede { color: var(--tx-p); max-width: 44ch; margin: 18px 0 0; font-size: .95rem; font-weight: 300; }
/* les deux usages de l'outil : crise réelle (rouge) et exercice (bleu) */
.auth-aside .pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 36px; max-width: 600px; }
.auth-aside .pillar { border-top: 1px solid var(--line2); padding-top: 14px; }
.auth-aside .pillar b { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: .95rem; color: var(--tx); }
.auth-aside .pillar > span { display: block; margin-top: 6px; color: var(--tx-p); font-size: .84rem; font-weight: 300; line-height: 1.55; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
/* seule surface floutée de l'application : posée sur un fond fixe, elle n'est jamais recalculée au défilement d'un contenu */
.auth-card { width: 100%; max-width: 400px; padding: 32px 32px 28px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.auth-card h1 { font-size: 1.75rem; font-weight: 300; margin-bottom: 8px; }
.auth-card .lead { color: var(--txm); margin-bottom: 26px; }
.auth-card .btn-primary { height: 44px; font-size: .9rem; font-weight: 500; }
.auth-card .input { min-height: 42px; background: transparent; }

/* ---------- informations légales ---------- */
.auth-main { flex-direction: column; gap: 28px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .76rem; }
.legal-links a { color: var(--txl); text-decoration: none; }
.legal-links a:hover { color: var(--tx); text-decoration: underline; }
.auth-legal { justify-content: center; max-width: 400px; }
.side-legal { margin: 28px 10px 0; padding-top: 14px; border-top: 1px solid var(--line); gap: 4px 12px; }
.legal-page { max-width: 920px; }
.legal-public { margin: 0 auto; padding: 36px 44px 80px; }
.legal-doc h2 { margin-top: 28px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc p, .legal-doc li { max-width: 68ch; }
.legal-doc .table-wrap { margin: 8px 0 4px; }
.legal-list { padding-left: 18px; margin: 8px 0; }
.legal-list li + li { margin-top: 4px; }
.legal-tbl td { font-size: .84rem; vertical-align: top; }
.legal-tbl td:first-child { font-weight: 500; }
.legal-missing { background: var(--part-bg); color: var(--part-tx); border-radius: var(--radius-xs); padding: 1px 6px; font-size: .82rem; }
.legal-meta { color: var(--txl); font-size: .78rem; margin-top: 20px; }
.legal-doc > .legal-meta:first-child { margin: 0 0 8px; }
.legal-accept { margin-top: 16px; position: sticky; bottom: 0; box-shadow: var(--shadow-pop); }
.legal-accept .row { margin-top: 12px; }
.lbl .req { color: var(--nc-tx); }
@media (max-width: 720px) { .legal-public { padding: 24px 16px 60px; } }

/* ---------- modales & toasts ---------- */
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-modal); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto; animation: fade .18s ease-out; }
.modal { background: var(--panel); border-radius: var(--radius-lg); width: 100%; max-width: 560px; box-shadow: var(--shadow-pop), 0 0 0 1px rgb(var(--shade) / .06); animation: modal-in .22s var(--ease-out); }
.modal-wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px 6px; }
.modal-head h3 { flex: 1; margin: 0; font-size: 1.05rem; }
.modal-body { padding: 12px 22px 18px; max-height: 70vh; overflow-y: auto; }
/* liste d'actions dans une fenêtre : une action par ligne, avec son explication */
.act-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.act-list .btn { justify-content: flex-start; height: auto; min-height: 40px; padding: 8px 12px; white-space: normal; text-align: left; }
.act-list .btn .act-d { display: block; font-size: .76rem; font-weight: 400; color: var(--txm); }
.act-list .btn-danger .act-d { color: rgb(255 255 255 / .88); }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes fade { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
/* sortie plus rapide que l'entrée, par le même chemin */
.modal-backdrop.out { pointer-events: none; animation: fade-out .14s ease-out forwards; }
.modal-backdrop.out .modal { animation: modal-out .14s ease-out forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(4px) scale(.98); } }
/* erreur de saisie sous le champ, jusqu'à correction */
.field-err { color: var(--nc-tx); font-size: .76rem; margin-top: 5px; }
.input[aria-invalid="true"] { border-color: var(--nc); }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: var(--panel); color: var(--tx); border: 1px solid var(--line2); padding: 11px 16px 11px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); font-size: .85rem; display: flex; align-items: center; gap: 10px; transition: opacity .2s ease, transform .2s ease; animation: toast-in .3s var(--ease-out); }
/* le point indique le type de message (erreur / succès) */
.toast-error::before, .toast-ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.toast-error::before { background: var(--nc); } .toast-ok::before { background: var(--ok); }
.toast.out { opacity: 0; transform: translateY(4px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.empty { text-align: center; color: var(--txm); padding: 48px 16px; }
.loading { color: var(--txm); padding: 20px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--line2); border-top-color: var(--brand); border-radius: 50%; animation: spin .6s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
svg text { font-family: var(--font); }

/* ---------- missions ---------- */
.m-card { position: relative; display: flex; flex-direction: column; gap: 16px; height: 100%; margin: 0; padding: 20px 22px; transition: border-color .15s ease; }
.m-card:hover { border-color: var(--accline); }
.m-card .m-title { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.m-card .m-title a { text-decoration: none; }
.m-card .m-title a::after { content: ""; position: absolute; inset: 0; }
.m-card .btn { position: relative; z-index: 1; }
.m-card .m-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--txl); }
.fw-line { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; margin-bottom: 6px; }
.fw-line .n { font-family: var(--mono); font-size: .74rem; color: var(--txm); }
/* accès & fonctionnalités : un module, puis son périmètre (référentiels, méthodes) */
.module-row { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.module-row .scope-block { margin: 12px 0 0; }
.scope-items { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--panel);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 4px 16px; }
.scope-items .check { align-items: flex-start; }
.scope-items .check input { margin-top: 3px; }
/* choix du type de mission (création) : deux options exclusives, boutons radio natifs */
.kind-pick { border: 0; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kind-pick legend { padding: 0; grid-column: 1 / -1; }
.kind-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line2); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.kind-opt:hover { border-color: var(--accline); }
.kind-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); }
.kind-opt input { margin-top: 3px; }
.kind-opt b { display: block; font-weight: 600; font-size: .9rem; }
.kind-opt .kind-ic { color: var(--brand); display: inline-flex; margin-top: 1px; }
@media (max-width: 640px) { .kind-pick { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.search { position: relative; flex: 0 1 340px; }
.search svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--txl); width: 16px; height: 16px; pointer-events: none; }
.search .input { padding-left: 34px; }

/* ---------- accueil, guide ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: 24px; color: #eceef4; background: var(--halos-hero), #050507; border: 1px solid rgb(236 238 244 / .15); }
.hero h2 { font-size: 1.35rem; margin: 0 0 6px; color: #eceef4; }
.hero p { margin: 0; color: #c9cdd9; max-width: 70ch; }
.hero .hero-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero .hero-steps span { display: inline-flex; align-items: center; gap: 8px; background: rgb(236 238 244 / .06); border: 1px solid rgb(236 238 244 / .15); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: .8rem; font-weight: 500; }
.hero .hero-steps b { width: 22px; height: 22px; border-radius: 50%; background: rgb(129 150 255 / .16); color: #8196ff; display: inline-grid; place-items: center; font-size: .72rem; font-variant-numeric: tabular-nums; }
.hero .btn { position: relative; z-index: 1; background: #eceef4; color: #050507; border-color: #eceef4; }
.hero .btn:hover { background: #fff; color: #050507; }
.hero .btn-ghost-w { background: transparent; color: #eceef4; border-color: rgb(236 238 244 / .3); }
.hero .btn-ghost-w:hover { background: transparent; border-color: rgb(236 238 244 / .6); color: #fff; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; margin-bottom: 24px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-top: 3px solid var(--c, var(--brand)); }
.step .n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--c, var(--brand)) 14%, transparent); color: var(--c, var(--brand)); margin-bottom: 10px; }
.step h3 { margin: 0 0 6px; font-size: .95rem; }
.step p { margin: 0; font-size: .84rem; color: var(--txm); }
.legend-res { display: flex; flex-wrap: wrap; gap: 8px; }
.legend-res span { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.legend-res i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
details.fwg { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--brand)); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); }
details.fwg > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
details.fwg > summary::-webkit-details-marker { display: none; }
/* chevron de la famille d'icônes (Phosphor caret-right), en masque pour suivre la couleur */
:root { --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z'/%3E%3C/svg%3E"); }
details.fwg > summary::after { content: ""; width: 12px; height: 12px; background: var(--c, var(--brand)); -webkit-mask: var(--caret) center / contain no-repeat; mask: var(--caret) center / contain no-repeat; margin-left: auto; transition: transform .15s ease; }
details.fwg[open] > summary::after { transform: rotate(90deg); }
details.fwg > summary:hover { background: var(--hover); border-radius: var(--radius); }
details.fwg .fwg-body { padding: 0 18px 16px; font-size: .88rem; }
details.fwg .fwg-body h4 { margin: 14px 0 4px; color: var(--c, var(--brand)); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
details.fwg .fwg-body p { margin: 0 0 6px; }
.fwg-t { font-weight: 600; }
.cat-h { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.cat-h h2 { margin: 0; }
.cat-h .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--brand)); }
.fw-card { border-top: 3px solid var(--c, var(--brand)) !important; transition: transform .15s var(--ease-out); }
.fw-card:hover { transform: translateY(-2px); }
/* arbre du catalogue : sections repliables */
details.tree-sec { border-top: 1px solid var(--line); }
details.tree-sec > summary { cursor: pointer; padding: 8px 4px; font-weight: 600; list-style: none; display: flex; gap: 8px; align-items: center; }
details.tree-sec > summary::-webkit-details-marker { display: none; }
details.tree-sec > summary::before { content: ""; width: 12px; height: 12px; background: var(--brand); -webkit-mask: var(--caret) center / contain no-repeat; mask: var(--caret) center / contain no-repeat; transition: transform .15s ease; display: inline-block; flex-shrink: 0; }
details.tree-sec[open] > summary::before { transform: rotate(90deg); }
details.tree-sec > summary:hover { background: var(--hover); border-radius: var(--radius-xs); }
/* choix de la langue des livrables */
.lang-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.lang-pick label { flex: 1; min-width: 150px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; background: var(--panel); transition: border-color .15s ease, background-color .15s ease; }
.lang-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); }
.lang-pick input { margin-top: 3px; }

/* ---------- incidents ---------- */
.inc-card { border-left: 4px solid var(--c-amber); }
.inc-card.inc-late { border-left-color: var(--nc); }
.inc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 12px; }
.inc-reg { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.inc-step { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: .84rem; }
.inc-reg .lbl + .inc-step { border-top: 0; }
.inc-step .badge { min-width: 104px; justify-content: center; }

@media (max-width: 1100px) { #dashGrid { grid-template-columns: minmax(0, 1fr) !important; } }
#top .top-search { position: relative; flex: 0 1 260px; margin-right: 6px; }
#top .top-search svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--txl); pointer-events: none; }
#top .top-search input { height: 34px; min-height: 34px; padding-left: 32px; font-size: .82rem; background: var(--panel); }
@media (max-width: 900px) { #top .top-search { display: none; } }

/* ---------- registres réglementaires ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 12px; }
.form-sep { margin: 8px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--brand-tx); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 700px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.reg-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tag-crit { background: var(--nc-bg); color: var(--nc-tx); }
.tbl td .chips { gap: 4px; }

/* ---------- assistant d'applicabilité ---------- */
.wiz-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .wiz-grid { grid-template-columns: minmax(0, 1fr); } }
.wiz-q { margin-bottom: 18px; }
.wiz-q > .lbl { font-size: .86rem; color: var(--tx); font-weight: 600; margin-bottom: 8px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice label { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer; background: var(--panel); font-size: .84rem; transition: border-color .15s ease, background-color .15s ease; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); color: var(--brand-tx); font-weight: 500; }
.choice input { margin: 0; }
.res-card { border-left: 4px solid var(--c, var(--brand)); }
.res-card .card-head h3 { font-size: 1rem; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 6px 0 10px; font-size: .86rem; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 3px solid var(--c, var(--brand)); }
.tl-item.past { opacity: .7; }
.tl-item.past::before { background: var(--c, var(--brand)); }
.tl-item .d { font: 600 .78rem var(--mono); color: var(--c, var(--brand)); }

/* ---------- analyse de risque guidée ---------- */
.study-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.study-grid > aside { position: sticky; top: 0; }
@media (max-width: 1200px) { .study-grid { grid-template-columns: minmax(0, 1fr); } .study-grid > aside { position: static; } }
.phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-bottom: 20px; }
.phase { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--txm); text-decoration: none; font-size: .8rem; font-weight: 500; min-width: 0; transition: background-color .15s ease, border-color .15s ease; }
.phase:hover { background: var(--hover); color: var(--tx); }
.phase .n { flex-shrink: 0; width: 24px; height: 24px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--soft); color: var(--txm); font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.phase .n svg.i { width: 13px; height: 13px; }
.phase .t { min-width: 0; line-height: 1.25; }
.phase.done .n { background: var(--ok-bg); color: var(--ok-tx); }
.phase.on { border-color: var(--brand); background: var(--brand-bg); color: var(--brand-tx); }
.phase.on .n { background: var(--brand); color: var(--on-ink); }
.issue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .8rem; }
.issue-list li { display: flex; gap: 8px; align-items: flex-start; }
.issue-list .badge { flex-shrink: 0; min-width: 74px; justify-content: center; }
.gate { border-top: 3px solid var(--line2); }
.gate.ok { border-top-color: var(--ok); } .gate.stale { border-top-color: var(--part); }
.input.input-sm, select.input.input-sm { min-height: 30px; padding: 4px 8px; font-size: .8rem; }
.measure-list { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; gap: 6px; }
.measure-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .84rem; }
.linklike { border: 0; background: none; padding: 0; font: inherit; font-weight: 500; color: var(--tx); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; cursor: pointer; text-align: left; }
.linklike:hover { text-decoration-color: currentColor; }
.chip.chip-warn { border-color: var(--part-line); background: var(--part-bg); color: var(--part-tx); }
.prop-group { margin: 8px 0; } .prop-group > summary { cursor: pointer; padding: 4px 0; }
.prop-list { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 6px; max-height: 340px; overflow-y: auto; }
.prop-list .check { align-items: flex-start; font-size: .84rem; }
fieldset.cand { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0 0 10px; padding: 8px 12px; display: grid; gap: 4px; }
fieldset.cand legend { padding: 0 4px; font-size: .84rem; }
details.fair { margin-top: 6px; } details.fair > summary { cursor: pointer; color: var(--brand-tx); }
.fair-tbl { border-collapse: collapse; margin: 6px 0; font-size: .78rem; }
.fair-tbl th { text-align: left; font-weight: 500; color: var(--txm); padding: 2px 6px 2px 0; }
.fair-tbl td { padding: 2px 4px; } .fair-tbl input { width: 96px; font-variant-numeric: tabular-nums; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media print { .study-grid { display: block; } .print-avoid { break-inside: avoid; } }

/* ---------- graphiques (svg.js) ---------- */
.ch-track { stroke: var(--soft); }
.ch-grid { stroke: var(--line); }
.ch-tx { fill: var(--tx); }
.ch-txm { fill: var(--txm); }

/* ---------- module SRA : niveaux de risque (libellé toujours écrit, la couleur ne fait que le doubler) ---------- */
.lv { display: inline-block; padding: 2px 7px; border-radius: var(--radius-xs); font-size: .74rem; font-weight: 500; white-space: nowrap; background: var(--na-bg); color: var(--na-tx); }
.lv-vl { background: var(--ok-bg); color: var(--ok-tx); }
.lv-l { background: var(--info-bg); color: var(--info-tx); }
.lv-m { background: var(--part-bg); color: var(--part-tx); }
.lv-h { background: var(--nc-bg); color: var(--nc-tx); }
.lv-vh { background: var(--nc); color: var(--on-ink); }
.sra-heat td { width: 52px; height: 40px; color: var(--tx); }
.sra-heat td.lv-vh { color: var(--on-ink); }
.sra-sheet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; margin-bottom: 16px; background: var(--soft); border-radius: var(--radius-sm); font-size: .86rem; }
.stride-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
/* proposition + action : l'action passe sous le texte quand la place manque (mobile) */
.sra-sug { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; }
.sra-sug > :first-child { flex: 1 1 240px; min-width: 0; }
.lv-def { font-size: .78rem; color: var(--txm); }

/* ---------- impression (rapport) : toujours en clair ---------- */
.print-only { display: none; }
@media print {
  :root { color-scheme: light; --canvas: #fff; --bg: #fff; --main-bg: #fff; --panel: #fff; --soft: #eceef3; --line: #e1e3ea; --line2: #cdd0d9; --tx: #0b0b10; --txm: #5c6070; --txl: #6a6e7e; --ink: #0b0b10; --on-ink: #fff; }
  body::before { display: none; }
  #top, #side, .no-print, #toasts { display: none !important; }
  #app { display: block; height: auto; }
  #main { overflow: visible; padding: 0; border: 0; background: #fff; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  .page-break { break-before: page; }
  .tbl th { position: static; }
  .table-wrap { overflow: visible; border: 0; }
}

@media (hover: none) { .m-card:hover { border-color: var(--line); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 1100px) { #main { padding: 28px 28px 64px; } }
@media (max-width: 900px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  #top { grid-column: 1; padding: 0 12px; gap: 2px; }
  #top .menu-btn { display: inline-flex; }
  #top .hide-sm { display: none; }
  #top .crumbs .crumb-root, #top .crumbs .crumb-sep, #top .crumbs .crumb-meta { display: none; }
  #side { display: none; }
  #app.side-open #side { display: block; position: fixed; top: 0; bottom: 0; left: 0; width: 272px; z-index: var(--z-side); background: var(--bg); box-shadow: var(--shadow-pop); animation: side-in .22s var(--ease-out); }
  #main { grid-column: 1; border-left: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 22px 16px 56px; }
  h1 { font-size: 1.5rem; }
  .audit-layout { grid-template-columns: 1fr; }
  .req-list { max-height: 45vh; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { padding: 24px 20px 8px; gap: 24px; }
  .auth-aside .statement { font-size: 2.1rem; }
  .auth-card { padding: 24px 20px 20px; }
  .auth-lang { position: static; align-self: flex-end; }
  .auth-main { gap: 16px; padding-top: 16px; }
  .auth-aside .lede { display: none; }
  .auth-aside .pillars { grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
  .auth-aside .pillar > span { display: none; }
}
@keyframes side-in { from { transform: translateX(-12px); opacity: 0; } }

/* ---------------------------------------------------------------- cartographie (carte par couches) */
.carto-tools { gap: 10px; margin-bottom: 12px; }
.carto-tools .seg button { display: inline-flex; align-items: center; gap: 4px; }
.carto-tools .seg button svg { width: 16px; height: 16px; }
.carto-perf { font-variant-numeric: tabular-nums; }
.carto-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.carto-map { position: relative; height: calc(100vh - 230px); min-height: 420px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.carto-canvas { position: absolute; inset: 0; }
.carto-flow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.carto-mini { z-index: 2; }
.carto-mini { position: absolute; right: 12px; bottom: 12px; width: 180px; height: 116px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-sm); box-shadow: var(--shadow); cursor: crosshair; touch-action: none; }
.carto-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--txm); background: var(--bg); }
.carto-overlay[hidden] { display: none; }
.carto-overlay .empty { padding: 24px; max-width: 52ch; }
.carto-overlay .empty .small { margin: 6px 0 10px; }
.carto-side { position: sticky; top: 12px; width: 300px; max-height: calc(100vh - 230px); overflow: auto; }
.carto-side.wide { width: 400px; }
/* fiche objet dans le panneau latéral */
.sheet-tabs { gap: 0; margin: 12px 0 14px; }
.sheet-tabs .tab { padding: 7px 6px; font-size: .78rem; white-space: nowrap; flex-shrink: 0; }
.sheet-tabs .tab .count { font-size: .7rem; color: var(--txl); font-variant-numeric: tabular-nums; }
.sheet-desc { margin: 0 0 12px; white-space: pre-line; max-width: 68ch; }
.sheet-sum { margin: 0 0 12px; line-height: 1.9; }
.sheet-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.sheet-list li { display: grid; gap: 3px; min-width: 0; }
.sheet-list a { color: var(--brand-tx); overflow-wrap: anywhere; }
.sheet-list .badge { justify-self: start; }
.sheet-req .mono { color: var(--txm); margin-right: 4px; }
.sheet-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sheet-ov dd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; white-space: normal; }
.sheet-ov .badge svg { width: 12px; height: 12px; }
.sheet-chain { margin: 8px 0 0; }
.sheet-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sheet-hist > li { border-left: 2px solid var(--line); padding-left: 10px; }
.sheet-diff { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.sheet-diff del { color: var(--txl); }
.sheet-diff ins { color: var(--tx); font-weight: 500; text-decoration: none; }
.carto-name { margin: 2px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carto-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 12px; }
.carto-dl dt { color: var(--txm); }
.carto-dl dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.carto-nb { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.carto-nb li { display: grid; gap: 1px; min-width: 0; }
.carto-link { border: 0; background: none; padding: 0; font: inherit; color: var(--brand-tx); cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carto-link:hover { text-decoration: underline; }
/* liste des objets pour le clavier et les lecteurs d'écran : masquée, visible dès qu'elle reçoit le focus */
.carto-a11y { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.carto-a11y:focus-within { position: static; width: auto; height: auto; clip: auto; overflow: auto; max-height: 220px; margin-top: 12px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.carto-a11y ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.carto-a11y button { border: 0; background: none; padding: 2px 4px; font: inherit; font-size: .82rem; color: var(--tx); cursor: pointer; text-align: left; border-radius: var(--radius-xs); }
.carto-a11y button:hover { background: var(--hover); }
.carto-legend ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; color: var(--txm); }
.carto-legend li { display: flex; align-items: flex-start; gap: 8px; }
.carto-legend li > svg, .carto-legend li > .carto-key { flex-shrink: 0; margin-top: 4px; }
.carto-dir { display: block; }
.carto-key { display: inline-block; width: 28px; height: 14px; border-radius: var(--radius-xs); background: var(--panel); }
.carto-key.crit { border: 3px double var(--tx); }
.carto-key.grp { border: 1.5px dashed var(--line2); background: var(--soft); }
@media (max-width: 1100px) {
  .carto-layout { grid-template-columns: 1fr; }
  .carto-side, .carto-side.wide { position: static; max-height: none; width: auto; }
  .carto-map { height: 62vh; }
}
@media (max-width: 600px) { .carto-mini { width: 112px; height: 72px; right: 8px; bottom: 8px; } }

/* calques de la carte : sélecteur et légende flottante (états, effectifs, isolement) */
.carto-ovsel { display: inline-flex; align-items: center; gap: 6px; }
.carto-ovsel .input { width: auto; height: 30px; padding: 2px 8px; font-size: .82rem; }
.carto-ovlegend { position: absolute; top: 12px; left: 12px; z-index: 2; max-width: 270px; max-height: calc(100% - 150px); overflow: auto; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.carto-ovlegend[hidden] { display: none; }
.carto-ovlegend .lbl { margin-bottom: 6px; }
.carto-ovlist { display: grid; gap: 2px; margin-bottom: 6px; }
.carto-ovitem { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; border: 1px solid transparent; background: none; padding: 3px 6px; font: inherit; font-size: .8rem; color: var(--tx); text-align: left; cursor: pointer; border-radius: var(--radius-xs); }
.carto-ovitem:hover { background: var(--hover); }
.carto-ovitem.on { border-color: var(--brand); background: var(--brand-bg); }
.carto-ovitem .count { color: var(--txm); font-variant-numeric: tabular-nums; }
.carto-sw { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 14px; border-radius: var(--radius-xs); border: 1.5px solid var(--line2); background: var(--panel); }
.carto-sw svg { width: 10px; height: 10px; }
.carto-sw.ov-compliant, .carto-sw.ov-cov_full { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.carto-sw.ov-partially_compliant, .carto-sw.ov-cov_low { background: var(--part-bg); border-color: var(--part); color: var(--part); }
.carto-sw.ov-cov_partial { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.carto-sw.ov-non_compliant, .carto-sw.ov-cov_none { background: var(--nc-bg); border-color: var(--nc); color: var(--nc); }
.carto-sw.ov-presumed { background: var(--info-bg); border-color: var(--info); border-style: dashed; color: var(--info); }
.carto-sw.ov-not_assessed, .carto-sw.ov-not_estimated, .carto-sw.ov-unavailable { border-style: dashed; color: var(--txl); }
.carto-sw.ov-none { color: var(--txl); }

/* inventaire de la cartographie : tableau virtualisé (hauteur de ligne fixe, voir ROW_H dans inventory.js) */
.inv-card { padding: 16px 18px; }
.inv-filters { gap: 8px; margin-bottom: 12px; }
.inv-filters .input { width: auto; max-width: 220px; height: 32px; padding: 2px 8px; font-size: .82rem; }
.inv-filters .inv-q { min-width: 220px; }
.inv-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.inv-scroll { position: relative; height: calc(100vh - 300px); min-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.inv-tbl { table-layout: fixed; width: 100%; min-width: 1080px; margin: 0; }
.inv-tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.inv-tbl tbody tr:not(.inv-spacer) td { height: 38px; padding-top: 0; padding-bottom: 0; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-tbl .inv-spacer td { padding: 0; border: 0; }
.inv-tbl th:first-child { width: 24%; }
.inv-tbl .inv-name .carto-link { max-width: 100%; display: inline-block; vertical-align: middle; }
.inv-tbl .badge svg { width: 12px; height: 12px; }
.inv-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.inv-sort:hover { color: var(--tx); }
.inv-state:empty { display: none; }
.inv-filters [hidden] { display: none; }

/* heatmap des risques de la cartographie */
.hm-card { padding: 18px 20px; }
.hm-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.hm-levels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hm-grid { gap: 24px; }
.hm-block h3 { margin: 0 0 8px; }
.carto-heat .hm-y { text-align: right; max-width: 140px; }
.carto-heat .hm-x { max-width: 96px; vertical-align: top; }
.carto-heat td { padding: 0; width: 64px; height: 50px; }
.hm-cell { width: 100%; height: 100%; min-height: 46px; border: 2px solid transparent; border-radius: var(--radius-xs); color: var(--on-data); font: inherit; cursor: pointer; display: grid; place-items: center; align-content: center; gap: 0; }
.hm-cell b { font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hm-cell .hm-lv { font-size: .66rem; opacity: .85; }
.hm-cell.no-lv { color: var(--tx); }
.hm-cell.empty { cursor: default; opacity: .55; }
.hm-cell:not(.empty):hover { border-color: var(--tx); }
.hm-cell.on { border-color: var(--brand); outline: 2px solid var(--brand); }
.carto-filter[hidden] { display: none; }
.carto-filter .chip { gap: 6px; }

/* étape 8 : vues sauvegardées, édition, instantanés, demandes d'effacement */
.carto-bar { gap: 8px; margin-bottom: 8px; }
.carto-bar .btn svg { width: 14px; height: 14px; }
.carto-snap { margin-bottom: 12px; }
.carto-snap[hidden] { display: none; }
.carto-snap .row { gap: 10px; }
.carto-snap .grow, .carto-bar .grow { flex: 1; }
.sheet-actions { gap: 6px; margin: 4px 0 2px; }
.sheet-del { margin-left: auto; color: var(--nc-tx); }
.sheet-list li { position: relative; }
.sheet-list li:has(> .sheet-rm) { padding-right: 30px; }
.sheet-rm { position: absolute; top: -2px; right: 0; width: 26px; height: 26px; color: var(--txl); }
.sheet-rm:hover { color: var(--nc-tx); }
.sheet-rm svg { width: 14px; height: 14px; }
.snap-sha { user-select: all; }
.er-ctx { overflow-wrap: anywhere; max-width: 68ch; }
/* export PDF de la carte : seule l'image filigranée est imprimée */
.carto-print { display: none; }
@media print {
  body.carto-print-mode > :not(#cartoPrint) { display: none !important; }
  body.carto-print-mode #cartoPrint { display: block; }
  #cartoPrint img { display: block; width: 100%; height: auto; }
}

/* ---------------------------------------------------------------- navigation en verre (ordinateur uniquement)
   Rail latéral flottant, replié (64px) et déplié au survol ou à la navigation clavier (208px, par-dessus le contenu),
   épinglable (il pousse alors le contenu). Barre haute en bulles séparées, au-dessus de la zone qui défile.
   Écrire seulement backdrop-filter (sans variante préfixée à la main) : voir la note du prompt de conception. */
@media (min-width: 901px) {
  #app { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  #rail-space { display: block; grid-column: 1; grid-row: 1; width: 88px; transition: width .26s cubic-bezier(.2, .8, .2, 1); }
  #app.rail-pinned #rail-space { width: 232px; }
  #app.no-side #rail-space { display: none; }

  /* rail */
  #side.rail { position: fixed; top: 12px; bottom: 12px; left: 12px; z-index: var(--z-side); width: 64px;
    display: flex; flex-direction: column; padding: 10px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin;
    border-radius: 20px; border: 1px solid var(--glass-edge); background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(190%) brightness(1.08);
    box-shadow: inset 0 1px 0 var(--glass-hi), inset 1px 0 0 var(--glass-hi), inset 0 0 24px var(--glass-glow), var(--glass-shadow);
    transition: width .26s cubic-bezier(.2, .8, .2, 1); }
  #side.rail > * { flex-shrink: 0; }
  #side.rail:hover, #side.rail:has(:focus-visible), #side.rail[data-pinned] { width: 208px; }
  /* délai à l'ouverture seulement : traverser le rail avec la souris ne le déplie pas */
  #side.rail:hover { transition-delay: .1s; }

  /* tête : monogramme (replié) puis logo complet + nom de l'outil (déplié), anneau au même endroit (centre à 21px) */
  #side.rail .brand { position: relative; display: block; height: 42px; margin: 0 0 10px; padding: 0; border-bottom: 1px solid var(--glass-edge); color: var(--tx); text-decoration: none; }
  #side.rail .brand-mono { display: block; position: absolute; left: 11px; top: 11px; width: 20px; height: 20px; }
  #side.rail .brand-mono svg { display: block; width: 20px; height: 20px; }
  #side.rail .brand-full { position: absolute; left: 13.35px; top: 13px; width: 172px; height: 16px; flex-direction: row; align-items: center; gap: 9px; }
  #side.rail .brand-full .onsec-logo { flex-shrink: 0; width: 79px; height: 16px; }
  #side.rail .brand-rule { display: block; flex-shrink: 0; width: 1px; height: 16px; background: var(--glass-edge); }
  #side.rail .brand-n { flex: 1; min-width: 0; display: block; font-size: 13px; line-height: 16px; color: var(--txm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* entrées : l'icône ne bouge pas, c'est la largeur du rail qui coupe les libellés */
  #side.rail .nav { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; height: 40px; min-height: 40px; padding: 0 12px;
    border: 0; border-radius: 11px; background: transparent; color: var(--sidetx); font: inherit; font-size: .875rem; text-align: left; text-decoration: none; cursor: pointer; box-shadow: none; }
  #side.rail .nav + .nav { margin-top: 2px; }
  #side.rail .nav .nav-ic { width: 18px; height: 18px; border-radius: 0; background: none; color: var(--c, var(--txm)); }
  #side.rail .nav .nav-ic svg.i { width: 18px; height: 18px; }
  #side.rail .nav .nav-l { white-space: nowrap; overflow: hidden; text-overflow: clip; }
  #side.rail .nav:hover, #side.rail .nav.on { background: var(--glass-item); color: var(--tx); }
  #side.rail .nav.on { box-shadow: inset 0 1px 0 var(--glass-hi); font-weight: 500; }
  #side.rail .nav.on .nav-ic { background: none; color: var(--c, var(--brand)); }
  #side.rail .nav.on::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); box-shadow: 0 0 10px var(--brand); }
  #side.rail .nav:focus-visible { outline-offset: -2px; }

  /* titres de groupe ; replié, un trait de 18px les remplace (le premier groupe n'a pas de titre) */
  #side.rail .grp { position: relative; height: 24px; margin: 14px 0 4px; padding: 0 12px; white-space: nowrap; }
  #side.rail .grp::after { content: ""; position: absolute; left: 12px; top: 50%; width: 18px; height: 1px; background: var(--glass-edge); }

  /* pied : mentions légales (largeur fixe, coupées par le rail) et bouton « Garder ouvert » */
  #side.rail .rail-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
  #side.rail .rail-fit { width: 186px; }
  #side.rail .side-legal { margin: 0; padding: 10px 12px 6px; border-top: 1px solid var(--glass-edge); }
  #side.rail .rail-pin { display: flex; }

  /* fondus entre replié et déplié */
  #side.rail :is(.nav-l, .count, .grp-l, .brand-full, .brand-mono, .rail-fit), #side.rail .grp::after { transition: opacity .2s ease; }
  #side.rail:hover :is(.nav-l, .count, .grp-l, .brand-full, .brand-mono, .rail-fit), #side.rail:hover .grp::after { transition-delay: .1s; }
  #side.rail .brand-mono, #side.rail .grp::after { opacity: 0; }
  #side.rail:not([data-pinned]):not(:hover):not(:has(:focus-visible)) :is(.nav-l, .count, .grp-l, .brand-full, .rail-fit) { opacity: 0; }
  #side.rail:not([data-pinned]):not(:hover):not(:has(:focus-visible)) .brand-mono,
  #side.rail:not([data-pinned]):not(:hover):not(:has(:focus-visible)) .grp::after { opacity: 1; }

  /* barre haute : plus de barre pleine, des bulles compactes au-dessus de la zone qui défile */
  #top { grid-column: 2; grid-row: 1; align-self: start; position: relative; z-index: 40; height: 36px; margin: 10px 20px 0; padding: 0; gap: 8px; background: transparent; pointer-events: none; }
  #top > * { pointer-events: auto; }
  #top .bubble { height: 36px; display: flex; align-items: center; border-radius: 999px; border: 1px solid var(--glass-edge);
    background: var(--glass-bg); background-color: var(--glass-bubble-fill);
    backdrop-filter: blur(28px) saturate(190%) brightness(1.08);
    box-shadow: inset 0 1px 0 var(--glass-hi), inset 1px 0 0 var(--glass-hi), inset 0 0 24px var(--glass-glow), var(--glass-shadow); }
  #top .btn-top { height: 30px; }
  #top .avatar { width: 24px; height: 24px; }
  /* contexte de l'événement : niveau court et T+ (et EXERCICE) ; organisation et titre en fondu au survol ou au focus */
  #top .crumbs { flex: 0 1 auto; gap: 6px; }
  #top .crumbs.ctx { padding: 0 5px 0 6px; }
  #top .crumbs:not(.ctx) { visibility: hidden; }
  #top .crumbs .crumb-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
    transition: max-width .26s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
  #top .crumbs.ctx:hover .crumb-title, #top .crumbs.ctx:focus-within .crumb-title { max-width: 460px; opacity: 1; margin: 0 4px 0 8px; }
  #top .crumbs .lvl-full { display: none; }
  #top .crumbs .lvl-short { display: inline-flex; padding: 2px 9px 2px 8px; }
  #top .crumbs .tag { border-radius: 999px; background: transparent; }
  #top .crumbs .ex-flag { border-radius: 999px; }
  /* compte et réglages : initiales seules, synchronisation réduite à un point (nombre en attente s'il y en a) */
  #top .top-group { display: flex; flex-shrink: 0; gap: 2px; padding: 0 3px; margin-left: auto; }
  #top .top-group .btn-top { border-radius: 999px; }
  #top .top-group .btn-top:hover { background: var(--glass-item); }
  #top .top-group .user { padding: 0 3px; }
  #top .top-group .user-n, #top .top-group .sync-t { display: none; }
  #top .top-group .sync { margin: 0 4px 0 10px; gap: 4px; }
  #top .top-group .sync-q { display: inline; font: 500 .72rem/1 var(--mono); color: var(--part-tx); }
  /* langue et thème : réglés dans « Mon compte » sur ordinateur (le mobile garde ses boutons) */
  #top .top-group .top-lang, #top .top-group .top-theme { display: none; }
  /* défilement vers le bas : les bulles se rangent ; elles reviennent en remontant ou au focus clavier */
  #top > * { transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
  #top.tucked:not(:focus-within) > * { transform: translateY(-56px); opacity: 0; pointer-events: none; }

  #main { grid-column: 2; grid-row: 1; border: 0; border-radius: 0; padding-top: 60px; }
  #main .detail, #main .study-grid > aside { top: 54px; }
}
@media (min-width: 901px) and (prefers-reduced-motion: reduce) {
  #rail-space, #side.rail, #side.rail *, #side.rail .grp::after, #top .crumb-title, #top > * { transition: none !important; }
}
@media print { #rail-space { display: none !important; } }
