/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   Velyx Management : DA « nouvelle Velocity » (kit V4 de WEB/RadialcefUI, menu personnel F1 et staffboard).
   Référence : .claude/skills/velocity-da (SKILL.md, references/tokens.md, components.md), src/main.css,
   components/menu/menuBase.css, overlays/menus/personal-menu/pmKit.css.
   - Jetons recopiés de src/main.css (triplets -rgb) ; couleur d'action = velocity_color du config.cfg, posée au démarrage
     sur --accent-rgb (shell.js, /api/meta identity), repli : couleur par défaut du serveur.
   - Tout est carré : aucun arrondi (sauf points d'état, pastilles rondes et touches à 2 px), aucune bordure de couleur,
     aucun flou. Surfaces codifiées : --inv-panel, --inv-head, --inv-plate, --inv-field ; encres --inv-ink / -2 / -3.
   - Titres VelocityTitle (Montserrat Bold / ExtraBold), texte Montserrat 12 à 13,5 px, chiffres tabulaires, peu de majuscules.
   - Survol des atomes : voile uniforme + cadre de verre intérieur de 1 px ; appui : 1 px plus bas et plus sombre.
   - Grand menu : en-tête 48 px, rubriques à gauche (280 px, plaques de 44 px, rubrique active à la couleur d'action),
     page dans un panneau à bande de tête.
   Les anciens noms de variables du site (--surface, --line, --muted, --accent…) restent définis : ils pointent sur les
   jetons Velocity, pour les feuilles des modules (css/*.css) et les styles posés par les pages.
   ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: Montserrat;
  src: url("/fonts/montserrat.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Montserrat;
  src: url("/fonts/montserrat-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* Titres : Montserrat en graisse forte (même famille que le texte), comme VelocityTitle en jeu. */
@font-face {
  font-family: VelocityTitle;
  src: url("/fonts/montserrat.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  size-adjust: 96%;
}

/* ── Jetons (src/main.css) ── */
:root {
  --c-text-rgb: 255, 255, 255;
  --c-glass-rgb: var(--c-text-rgb);
  --c-black-rgb: 0, 0, 0;
  --c-bg-rgb: 10, 10, 10;
  --c-bg-1-rgb: 16, 16, 16;
  --c-bg-2-rgb: 21, 21, 21;
  --c-bg-3-rgb: 28, 28, 28;
  --c-bg-4-rgb: 37, 37, 37;
  --c-bg-5-rgb: 42, 42, 42;
  --c-night-950-rgb: 9, 10, 15;
  --c-night-900-rgb: 12, 14, 21;
  --c-night-850-rgb: 18, 18, 26;
  --c-gray-3-rgb: 115, 115, 115;
  --c-gray-7-rgb: 245, 245, 245;
  --c-stat-up-rgb: 134, 219, 94;
  --c-stat-down-rgb: 219, 94, 94;
  --c-inv-danger-rgb: 226, 69, 45;
  --c-orange-soft-rgb: 232, 163, 61;
  --c-amber-rgb: 245, 158, 11;
  --c-blue-light-rgb: 96, 165, 250;
  --c-blue-lighter-rgb: 147, 197, 253;
  --c-violet-light-rgb: 167, 139, 250;
  --c-cyan-rgb: 6, 182, 212;
  --c-gold-rgb: 255, 215, 0;
  --c-discord-rgb: 88, 101, 242;
  --c-red-lighter-rgb: 252, 165, 165;
  /* Couleurs des types de notification (notifColors.ts : notif-success / error / warning). */
  --c-notif-success-rgb: 93, 200, 50;
  --c-notif-error-rgb: 200, 50, 50;
  --c-notif-warning-rgb: 200, 178, 50;
  /* Couleur d'action : velocity_color (config.cfg), redéfinie au démarrage par shell.js. */
  --accent-rgb: 237, 29, 88;
  /* Couleur secondaire : velocity_color_secondary (dégradés du fond et de la tête du bloc de gauche). */
  --accent-2-rgb: 149, 19, 56;
  --on-accent-rgb: var(--c-text-rgb);

  --c-text: rgb(var(--c-text-rgb));
  --c-stat-up: rgb(var(--c-stat-up-rgb));
  --c-stat-down: rgb(var(--c-stat-down-rgb));
  --c-orange-soft: rgb(var(--c-orange-soft-rgb));
  --c-blue-lighter: rgb(var(--c-blue-lighter-rgb));
  --c-red-lighter: rgb(var(--c-red-lighter-rgb));

  /* Kit V4 (main.css, bloc « nouvelle Velocity ») */
  /* Site (pas d'interface en jeu) : surfaces pleines, sans fond décoratif. Page = --inv-panel, bloc de gauche = --inv-side,
     panneaux posés sur la page = --inv-plate. */
  --inv-panel: rgb(11, 11, 13);
  --inv-side: rgb(17, 17, 20);
  --inv-head: rgba(var(--c-glass-rgb), .025);
  --inv-shadow: 0 16px 36px rgba(var(--c-black-rgb), .45);
  --inv-solid: rgb(22, 22, 26);
  --inv-plate: rgb(19, 19, 22);
  --inv-field: rgb(10, 10, 12);
  --inv-cell: rgba(var(--c-glass-rgb), .055);
  --inv-cell-empty: rgba(var(--c-glass-rgb), .025);
  --inv-gauge: rgba(var(--c-glass-rgb), .12);
  --inv-keycap: rgba(var(--c-glass-rgb), .91);
  --inv-keycap-ink: rgb(var(--c-bg-1-rgb));
  --inv-ink: rgb(var(--c-gray-7-rgb));
  --inv-ink-2: rgba(var(--c-text-rgb), .8);
  --inv-ink-3: rgba(var(--c-text-rgb), .59);
  --inv-brand: rgb(var(--accent-rgb));
  --inv-on-brand: rgb(var(--on-accent-rgb));
  --inv-brand-shadow: 0 8px 22px rgba(var(--accent-rgb), .35);
  --inv-warn: var(--c-orange-soft);
  --inv-title-font: "VelocityTitle", "Montserrat", sans-serif;
  --inv-ease: cubic-bezier(.16, 1, .3, 1);
  --c-separator: rgba(var(--c-glass-rgb), .08);
  --inv-well: rgba(var(--c-glass-rgb), .05);
  --inv-pop: rgb(22, 22, 26);
  --inv-code: rgba(var(--c-black-rgb), .5);
  --logo-filter: none;
  /* Encart (inv-note), voile et ombre des boîtes (V4Modal), poignée de curseur. */
  --inv-note: rgba(var(--c-black-rgb), .28);
  --inv-backdrop: rgba(var(--c-black-rgb), .55);
  --inv-modal-shadow: 0 24px 60px rgba(var(--c-black-rgb), .55), 0 0 0 1px rgba(var(--c-glass-rgb), .07);
  --inv-knob: var(--c-text);
  /* Jetons de mouvement (main.css) */
  --v-ease: cubic-bezier(.16, 1, .3, 1);
  --v-ease-press: cubic-bezier(.4, 0, .6, 1);
  --v-ease-back: cubic-bezier(.34, 1.4, .64, 1);
  --v-ease-stretch: cubic-bezier(.65, 0, .35, 1);
  --v-fast: .1s;
  --v-mid: .18s;
  --v-slow: .32s;

  /* Anciens noms du site, redirigés vers les jetons Velocity (modules css/*.css, styles posés par les pages). */
  --bg: var(--inv-panel);
  --bg-2: rgba(var(--c-black-rgb), .4);
  --surface: var(--inv-plate);
  --surface-2: rgba(var(--c-glass-rgb), .04);
  --surface-3: rgba(var(--c-glass-rgb), .08);
  --line: var(--c-separator);
  --line-2: rgba(var(--c-glass-rgb), .14);
  --ink: var(--inv-ink);
  --ink-2: var(--inv-ink-2);
  --muted: var(--inv-ink-3);
  --faint: rgba(var(--c-text-rgb), .36);
  --accent: rgb(var(--accent-rgb));
  --accent-text: rgb(var(--accent-rgb));
  --accent-ink: rgb(var(--on-accent-rgb));
  --accent-soft: rgba(var(--accent-rgb), .14);
  --accent-line: rgba(var(--accent-rgb), .45);
  --blue: rgb(var(--c-blue-light-rgb));
  --violet: rgb(var(--c-violet-light-rgb));
  --amber: rgb(var(--c-amber-rgb));
  --danger: rgb(var(--c-inv-danger-rgb));
  --danger-soft: rgba(var(--c-inv-danger-rgb), .18);
  --warn: var(--c-orange-soft);
  --warn-soft: rgba(var(--c-orange-soft-rgb), .16);
  --ok: var(--c-stat-up);
  --ok-soft: rgba(var(--c-stat-up-rgb), .14);
  --hatch: rgba(var(--c-glass-rgb), .03);
  --check-a: var(--inv-well);
  --check-b: rgba(var(--c-glass-rgb), .025);
  --shadow: var(--inv-shadow);
  --glow: var(--inv-brand-shadow);
  --radius: 0;
  --radius-sm: 0;
  --display: var(--inv-title-font);
  --font: Montserrat, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, Consolas, monospace;

  /* Mise en page : largeur du bloc de gauche, hauteur utile d'une page (fenêtre moins la bande de tête). */
  --frame-pad: 0px;
  --side-w: 272px;
  --page-h: calc(100vh - 64px);
  color-scheme: dark;
}

/* ── Mode clair (choisi dans le bloc du compte) : mêmes surfaces, encre sombre, voiles noirs. ── */
:root[data-theme="light"] {
  --c-glass-rgb: 24, 24, 34;
  --inv-panel: rgb(243, 243, 246);
  --inv-side: rgb(255, 255, 255);
  --inv-head: rgba(24, 24, 34, .025);
  --inv-shadow: 0 12px 32px rgba(24, 24, 34, .12);
  --inv-solid: rgb(255, 255, 255);
  --inv-plate: rgb(255, 255, 255);
  --inv-field: rgb(246, 246, 249);
  --inv-cell: rgba(24, 24, 34, .05);
  --inv-cell-empty: rgba(24, 24, 34, .025);
  --inv-gauge: rgba(24, 24, 34, .1);
  --inv-keycap: rgb(24, 24, 34);
  --inv-keycap-ink: rgb(255, 255, 255);
  --inv-ink: rgb(20, 20, 28);
  --inv-ink-2: rgba(20, 20, 28, .78);
  --inv-ink-3: rgba(20, 20, 28, .55);
  --inv-well: rgba(24, 24, 34, .05);
  --inv-pop: rgb(255, 255, 255);
  --inv-code: rgba(24, 24, 34, .06);
  --inv-warn: rgb(184, 112, 10);
  --c-stat-up: rgb(52, 150, 40);
  --c-blue-lighter: rgb(37, 99, 205);
  --c-separator: rgba(24, 24, 34, .09);
  --bg: var(--inv-panel);
  --faint: rgba(20, 20, 28, .36);
  --check-a: rgba(24, 24, 34, .05);
  --check-b: rgba(24, 24, 34, .02);
  --logo-filter: invert(1) hue-rotate(180deg);
  --c-red-lighter: rgb(180, 40, 20);
  --inv-note: rgba(24, 24, 34, .045);
  --inv-backdrop: rgba(24, 24, 34, .35);
  --inv-modal-shadow: 0 24px 60px rgba(24, 24, 34, .2), 0 0 0 1px rgba(24, 24, 34, .08);
  --inv-knob: var(--inv-ink);
  color-scheme: light;
}
:root[data-theme="light"] .m-DELETE, :root[data-theme="light"] .feed-item .fi.err,
:root[data-theme="light"] .action-btn.danger .ai { color: rgb(180, 40, 20); }
:root[data-theme="light"] select option { background: #fff; }
:root[data-theme="light"] input[type="date"], :root[data-theme="light"] input[type="datetime-local"], :root[data-theme="light"] input[type="time"] { color-scheme: light; }
:root[data-theme="light"] .map-wrap, :root[data-theme="light"] .map-wrap .leaflet-container { background: rgb(var(--c-night-950-rgb)); }

/* ── Tout est carré (DA) : seules les formes rondes admises gardent leur rayon. ── */
*, *::before, *::after { border-radius: 0 !important; box-sizing: border-box; }
.dot, .pm-dot, .jb-dot, .map-dot, .map-player, .spin, .legend i, .chart .tip i, .role-chip i, .legend-list i { border-radius: 50% !important; }
.kbd, .key { border-radius: 2px !important; }

html, body { margin: 0; }
html, body { height: 100%; }
body {
  background: var(--inv-panel);
  color: var(--inv-ink);
  font: 500 13.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgb(var(--accent-rgb)); color: var(--inv-on-brand); }
a { color: var(--inv-ink); text-decoration: none; }
a:hover { color: rgb(var(--accent-rgb)); }
code, .mono { font-family: var(--mono); font-size: .9em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--inv-title-font); font-weight: 700; letter-spacing: 0; }
svg.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.fill { fill: currentColor; stroke: none; }
.hidden { display: none !important; }
.display { font-family: var(--inv-title-font); }
.muted { color: var(--inv-ink-3); }
.accent { color: rgb(var(--accent-rgb)); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
/* Étiquette de champ / libellé (pm-caption du F1) : gris, 12 px, sans capitales. */
.label { color: var(--inv-ink-3); font-size: 12px; font-weight: 600; }
.eyebrow { color: var(--inv-ink-3); font-size: 12px; font-weight: 600; }

/* Barres de défilement carrées de 4 px (F1). */
* { scrollbar-width: thin; scrollbar-color: rgba(var(--c-glass-rgb), .18) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--c-glass-rgb), .18); }

/* Effet de survol commun des atomes (.lit) : voile uniforme + cadre de verre intérieur. */
.btn, .iconbtn, .close-btn, .account-btn, .nav-item, .tabs :is(button, .tab), .seg button, .chip, .action-btn, .folder, .tile, .ocard, .inv-slot,
.menu a, .menu button, .navmenu a, .palette .res, .sprite-grid button, .endpoint summary, .tree-node > .tn {
  position: relative; isolation: isolate;
}
.btn::before, .iconbtn::before, .close-btn::before, .nav-item::before, .tabs :is(button, .tab)::before, .seg button::before, .chip::before,
.action-btn::before, .folder::before, .tile::before, .ocard::before, .inv-slot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: rgba(var(--c-glass-rgb), .07); box-shadow: inset 0 0 0 1px rgba(var(--c-glass-rgb), .2);
  transition: opacity var(--v-mid) var(--inv-ease);
}
.btn:hover:not(:disabled)::before, .iconbtn:hover::before, .close-btn:hover::before, .nav-item:hover:not(.active)::before,
.tabs :is(button, .tab):hover:not(.on)::before, .seg button:hover:not(.on)::before, .chip:hover::before, .action-btn:hover:not(:disabled)::before,
.folder:hover::before, .tile:hover::before, .ocard:hover::before, .inv-slot:hover::before { opacity: 1; }
:is(.btn, .iconbtn, .close-btn, .nav-item, .tabs :is(button, .tab), .seg button, .action-btn, .chip):focus-visible {
  outline: 2px solid rgb(var(--accent-rgb)); outline-offset: -2px;
}

/* ══════════════ Coque : bloc de gauche + page, sur toute la fenêtre. La fenêtre ne défile jamais : chaque page a sa
   bande de tête fixe et sa zone de contenu qui défile (les listes défilent dans leur propre tableau). ══════════════ */
.app { height: 100vh; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); overflow: hidden; }
.side {
  height: 100vh; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--inv-side); box-shadow: inset -1px 0 0 var(--c-separator); z-index: 2;
}
/* Haut du bloc : compte (menu), état du serveur, mode d'affichage, recherche. */
.side-top { flex: none; display: grid; gap: 8px; padding: 14px 14px 12px; box-shadow: inset 0 -1px 0 var(--c-separator); }
.account { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; cursor: pointer; text-align: left;
  background: var(--inv-plate); color: var(--inv-ink); font: inherit; transition: background var(--v-mid);
  box-shadow: inset 0 0 0 1px var(--c-separator);
}
.account-btn:hover { background: rgba(var(--c-glass-rgb), .07); }
.account-btn .avatar { width: 38px; height: 38px; font-size: 13px; }
.account-btn .who-txt { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.account-btn .uname { font: 700 14px/1.25 var(--inv-title-font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn .urole { display: flex; align-items: center; gap: 6px; color: var(--inv-ink-3); font-size: 12px; font-weight: 600; min-width: 0; }
.account-btn .urole span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn > svg.ic { color: var(--inv-ink-3); }
.account .menu { top: calc(100% + 6px); left: 0; right: 0; min-width: 0; }
.side-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.side-status { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; min-width: 0; background: var(--inv-well); font-size: 12px; font-weight: 600; color: var(--inv-ink-2); white-space: nowrap; overflow: hidden; }
.side-status b { margin-left: auto; color: var(--inv-ink); font-variant-numeric: tabular-nums; }
.seg.theme-seg { gap: 4px; }
.seg.theme-seg button { height: 32px; width: 32px; padding: 0; justify-content: center; }
.side-search {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 6px 0 10px;
  border: 0; background: var(--inv-field); color: var(--inv-ink-3); font: 500 12.5px var(--font); cursor: pointer; text-align: left;
  box-shadow: inset 0 0 0 1px var(--c-separator); transition: box-shadow var(--v-mid) var(--inv-ease), color var(--v-mid);
}
.side-search:hover { color: var(--inv-ink-2); box-shadow: inset 0 0 0 1px rgba(var(--c-glass-rgb), .2); }
.side-search span { flex: 1; }
.side-search .kbd { height: 20px; font-size: 10.5px; background: var(--inv-well); color: var(--inv-ink-3); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.side-nav { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 16px; }
.nav-sec { display: flex; flex-direction: column; }
/* Titre de rubrique cliquable : replie / déplie la rubrique (hauteur animée par grid-template-rows). */
.nav-title { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 4px; background: none; border: 0;
  color: var(--inv-ink-3); font: 700 11.5px var(--font); text-align: left; cursor: pointer; transition: color .15s; }
.nav-title > span { flex: none; }
.nav-title::after { content: ""; order: 2; flex: 1; height: 1px; background: var(--c-separator); }
.nav-title .nav-count { order: 3; font-style: normal; font-size: 10.5px; opacity: 0; transition: opacity .15s; }
.nav-title svg { order: 4; width: 14px; height: 14px; flex: none; transition: transform .2s var(--inv-ease); }
.nav-title:hover { color: var(--inv-ink); }
.nav-sec.closed .nav-title svg { transform: rotate(-90deg); }
.nav-sec.closed .nav-title .nav-count { opacity: 1; }
.nav-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s var(--inv-ease); }
.nav-sec.closed .nav-body { grid-template-rows: 0fr; }
.nav-list { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
/* Rubrique : ligne de 36 px, marqueur à gauche quand elle est active. */
.nav-item {
  display: flex; flex-shrink: 0; align-items: center; gap: 12px; width: 100%; height: 36px; padding: 0 10px;
  background: transparent; color: var(--inv-ink-2); border: 0; font: 600 13px var(--font); text-align: left; cursor: pointer;
  transition: color var(--v-mid) var(--inv-ease), background var(--v-mid) var(--inv-ease);
}
.nav-item:hover { color: var(--inv-ink); background: rgba(var(--c-glass-rgb), .05); }
.nav-item svg.ic { width: 16px; height: 16px; color: var(--inv-ink-3); transition: color var(--v-mid) var(--inv-ease); }
.nav-item:hover svg.ic { color: var(--inv-ink); }
.nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.active { background: rgba(var(--accent-rgb), .14); color: var(--inv-ink); box-shadow: inset 3px 0 0 rgb(var(--accent-rgb)); }
.nav-item.active svg.ic { color: rgb(var(--accent-rgb)); }
.nav-item::before { display: none; }

.avatar {
  width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; flex: none;
  background: rgba(var(--accent-rgb), .2); color: var(--inv-ink); font: 700 11px var(--inv-title-font);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.cta-badge {
  min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center;
  background: var(--inv-well); color: var(--inv-ink-2); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.iconbtn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; flex: none;
  border: 0; background: var(--inv-plate); color: var(--inv-ink-2); transition: color var(--v-mid) var(--inv-ease);
}
.iconbtn:hover { color: var(--inv-ink); }
.iconbtn.active { color: rgb(var(--accent-rgb)); }
.iconbtn svg.ic { width: 18px; height: 18px; }
.dd { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; z-index: 60; padding: 6px;
  background: var(--inv-pop); box-shadow: var(--inv-shadow), inset 0 0 0 1px var(--c-separator); animation: fade .14s var(--inv-ease);
}
.menu .who { padding: 8px 10px 10px; box-shadow: inset 0 -1px 0 var(--c-separator); margin-bottom: 6px; }
.menu .who b { font: 700 14px var(--inv-title-font); display: block; }
.menu .who small { color: var(--inv-ink-3); font-weight: 600; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  color: var(--inv-ink-2); background: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.menu a:hover, .menu button:hover { background: rgba(var(--c-glass-rgb), .07); color: var(--inv-ink); }
.menu a.active { background: var(--inv-brand); color: var(--inv-on-brand); }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; height: 1px; background: var(--c-separator); margin: 6px 0; }

/* Barre mobile (petits écrans seulement). */
.mobile-bar { display: none; }

/* Page : colonne de droite, hauteur de la fenêtre. */
.page-col { min-width: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.main-panel { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--inv-panel); }
#main { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
/* Racine d'une page (posée par le routeur) : tête fixe, contenu qui défile. Sans .content, la page défile entière. */
.page { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; }
.page > * { flex: none; min-width: 0; }
.page > .content, .page > .explorer, .page > .map-page, .page > .fill { flex: 1 1 auto; min-height: 0; }
.page > .content { overflow-y: auto; overflow-x: hidden; }
#main > .loading { flex: 1; }
/* Plusieurs zones de contenu (chiffres puis onglets) : seule la dernière prend la hauteur restante et défile. */
.page > .content:not(:last-child) { flex: none; overflow: visible; padding-bottom: 0; }
.page.map-page { display: grid; height: auto; grid-template-rows: minmax(0, 1fr); }
/* Barre de famille (Carte / Joueurs sur la carte / Lieux) : une rangée pleine largeur au-dessus de la carte. */
.page.map-page:has(> .subnav) { grid-template-rows: auto minmax(0, 1fr); }
.page.map-page > .subnav { grid-column: 1 / -1; }
.page.map-page > .map-wrap { min-height: 0; }
.page.map-page > .map-side { max-height: none; min-height: 0; }
#main > .callout { margin: 16px; }

/* ── Bande de tête de page : titre, sous-titre, actions à droite ── */
.hero { position: relative; padding: 24px 20px; text-align: center; background: var(--inv-side); box-shadow: inset 0 -1px 0 var(--c-separator); }
.hero h1 { font: 700 26px/1.1 var(--inv-title-font); }
.hero h1 .thin { font-weight: 500; }
.hero p { color: var(--inv-ink-3); margin: 6px auto 0; max-width: 640px; font-size: 13px; font-weight: 500; }
.hero .hero-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero.left {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; text-align: left;
  min-height: 64px; padding: 10px 20px;
}
.hero.left > div:first-child { min-width: 0; flex: 1 1 auto; }
.hero.left h1 { font-size: 19px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero.left p { margin: 2px 0 0; max-width: 900px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero.left .eyebrow { margin-bottom: 2px !important; font-size: 11.5px; display: flex; align-items: center; gap: 6px; }
.hero.left > .row, .hero.left .hero-actions { gap: 6px; flex-wrap: nowrap; flex: none; margin: 0; }
.hero.left .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }
.content { padding: 16px 20px 24px; }

/* ── Panneaux (cartes) : plaque, bande de tête de 44 px ── */
.card { position: relative; background: var(--inv-plate); min-width: 0; box-shadow: inset 0 0 0 1px var(--c-separator); }
.card-pad { padding: 14px 16px; }
.card-head { display: flex; align-items: center; gap: 8px 12px; min-height: 44px; padding: 6px 6px 6px 16px; background: var(--inv-head); box-shadow: inset 0 -1px 0 var(--c-separator); flex-wrap: nowrap; }
.card-head h2 { font: 700 15px/1.2 var(--inv-title-font); white-space: nowrap; }
.card-head .sub { color: var(--inv-ink-3); font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-variant-numeric: tabular-nums; }
.card-head .spacer { min-width: 0; }
.card-head > .row, .card-head > .btn, .card-head > a { flex: none; }
.card-head .btn { height: 32px; padding: 0 12px; gap: 8px; font-size: 12.5px; }
.card-head .btn.icon { width: 32px; padding: 0; }
.card.glow { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 12px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; align-items: start; }
.stack { display: grid; gap: 12px; align-content: start; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }

/* Liste qui remplit la page (serverTable) : le contenu passe en colonne, les conteneurs simples qui mènent au tableau
   prennent la hauteur restante, le tableau défile seul avec son en-tête figé. Au-delà, le contenu défile normalement. */
.page > .content:last-child:has(.fill-table) { display: flex; flex-direction: column; padding-bottom: 16px; }
.page > .content:last-child :is(.stack, div:not([class])):has(.fill-table) { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.page > .content:last-child :is(.stack, div:not([class])):has(.fill-table) > * { flex-shrink: 0; }
.page > .content:last-child :is(.stack, div:not([class])):has(.fill-table) > .fill-table,
.page > .content:last-child > .fill-table { flex: 1 1 0; min-height: 300px; display: flex; flex-direction: column; overflow: hidden; }
.fill-table > .tbl-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fill-table > .tbl-body > .table-wrap { flex: 1; min-height: 0; overflow: auto; }
.fill-table > .tbl-body > .pager { flex: none; box-shadow: inset 0 1px 0 var(--c-separator); }
.fill-table th { position: sticky; top: 0; z-index: 1; }

/* ── Chiffres-clés (StatTile) ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { padding: 14px 16px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label ico" "value ico" "hint hint"; gap: 2px 12px; align-items: center; }
.kpi .top { display: contents; }
.kpi .top .label { grid-area: label; color: var(--inv-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .ico { grid-area: ico; width: 40px; height: 40px; display: grid; place-items: center; background: var(--inv-well); color: var(--inv-ink-2); flex: none; }
.kpi .ico svg.ic { width: 18px; height: 18px; }
.kpi.hl .ico { background: var(--inv-brand); color: var(--inv-on-brand); box-shadow: var(--inv-brand-shadow); }
.kpi .value { grid-area: value; font: 700 24px/1.15 var(--inv-title-font); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anum { display: inline-flex; align-items: baseline; max-width: 100%; }
.anum > span { display: inline-block; white-space: pre; }
.anum > span.roll { animation: digit-in .3s var(--v-ease) both; }
@keyframes digit-in { from { opacity: 0; transform: translateY(60%); } }
.kpi .hint { grid-area: hint; color: var(--inv-ink-3); font-size: 12px; font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════════ Boutons (Bt / UiButton : plaque .pl) ══════════════
   34 px (échelle compacte du site, champs de 34 px) ; sm 32, lg 44 comme le kit. Repos : plaque ; survol : voile .lit ;
   appui : 1 px plus bas et plus sombre ; désactivé : 35 %. Liseré inset : la plaque se pose sur des cartes de même teinte. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 34px; padding: 0 16px;
  border: 0; background: var(--inv-plate); color: var(--inv-ink-2); cursor: pointer; white-space: nowrap;
  font: 600 13px/1 var(--font);
  transition: color var(--v-mid) var(--v-ease), background var(--v-mid) var(--v-ease), box-shadow var(--v-mid) var(--v-ease),
    transform var(--v-fast) var(--v-ease-press), filter var(--v-fast) var(--v-ease-press);
  box-shadow: inset 0 0 0 1px var(--c-separator);
}
.btn:hover:not(:disabled) { color: var(--inv-ink); }
.btn:active:not(:disabled) { transform: translateY(1px); filter: brightness(.9); }
.btn:disabled { opacity: .35; cursor: default; transform: none; box-shadow: none; }
.btn.primary { background: var(--inv-brand); color: var(--inv-on-brand); box-shadow: var(--inv-brand-shadow); }
.btn.primary:hover:not(:disabled) { color: var(--inv-on-brand); }
.btn.white { background: var(--inv-keycap); color: var(--inv-keycap-ink); box-shadow: none; }
.btn.white:hover:not(:disabled) { color: var(--inv-keycap-ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover:not(:disabled) { color: var(--c-text); background: rgba(var(--c-inv-danger-rgb), .85); box-shadow: none; }
.btn.solid-danger { background: rgba(var(--c-inv-danger-rgb), .85); color: var(--c-text); box-shadow: none; }
.btn.solid-danger:hover:not(:disabled) { background: var(--danger); color: var(--c-text); }
/* Discret (Bt ghost) : transparent, la plaque apparaît au survol. */
.btn.ghost { background: transparent; color: var(--inv-ink-2); box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: var(--inv-plate); }
.btn.sm { height: 32px; padding: 0 12px; gap: 8px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.lg { height: 44px; padding: 0 16px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn svg.ic { width: 16px; height: 16px; }
.btn.discord { background: rgb(var(--c-discord-rgb)); color: var(--c-text); box-shadow: none; }
.btn.discord:hover:not(:disabled) { color: var(--c-text); }
/* Chargement (Bt loading) : pastille ronde qui tourne, bouton inactif. */
.btn.is-loading { pointer-events: none; }
.btn.is-loading::after { content: ""; flex: none; width: 14px; height: 14px; order: -1; border: 2px solid rgba(var(--c-glass-rgb), .25);
  border-top-color: currentColor; border-radius: 50% !important; animation: rot .6s linear infinite; }
.btn.primary.is-loading::after, .btn.solid-danger.is-loading::after { border-color: rgba(var(--on-accent-rgb), .3); border-top-color: currentColor; }
/* Bouton fermer (CloseButton) : plaque carrée de 32 px, croix de 16 px ; sm 22 px. */
.close-btn {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer;
  background: var(--inv-plate); color: var(--inv-ink-2); box-shadow: inset 0 0 0 1px var(--c-separator);
  transition: color var(--v-mid) var(--v-ease), transform var(--v-fast) var(--v-ease-press), filter var(--v-fast) var(--v-ease-press);
}
.close-btn:hover { color: var(--inv-ink); }
.close-btn:active { transform: translateY(1px); filter: brightness(.9); }
.close-btn svg.ic { width: 16px; height: 16px; }
.close-btn.sm { width: 22px; height: 22px; }
.close-btn.sm svg.ic { width: 12px; height: 12px; }

/* ══════════════ Champs (--inv-field) ══════════════ */
input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="date"], input[type="datetime-local"],
input[type="time"], input[type="url"], input[type="email"], input:not([type]), textarea {
  width: 100%; height: 34px; padding: 0 12px; border: 0; background: var(--inv-field); color: var(--inv-ink);
  font: 500 13.5px var(--font); outline: none; transition: box-shadow var(--v-mid) var(--v-ease), background var(--v-mid) var(--v-ease);
  box-shadow: inset 0 0 0 1px rgba(var(--c-glass-rgb), .08);
}
input::placeholder, textarea::placeholder { color: var(--inv-ink-3); }
input[type="date"], input[type="datetime-local"], input[type="time"] { color-scheme: dark; }
textarea { height: auto; min-height: 110px; padding: 10px 12px; font: 12.5px/1.6 var(--mono); resize: vertical; }
/* Focus (inv-field) : liseré de verre plus franc. */
input:focus, textarea:focus { box-shadow: inset 0 0 0 1px rgba(var(--c-glass-rgb), .4); }
input:disabled, select:disabled, textarea:disabled { opacity: .35; cursor: default; }
/* Liste déroulante (UiSelect) : plaque 600 12,5 px, chevron dessiné à la couleur du texte. */
select {
  width: 100%; height: 34px; padding: 0 32px 0 12px; border: 0; outline: none; appearance: none; text-overflow: ellipsis; cursor: pointer;
  background-color: var(--inv-plate); color: var(--inv-ink-2); font: 600 12.5px var(--font);
  box-shadow: inset 0 0 0 1px var(--c-separator);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
  transition: color var(--v-mid) var(--v-ease), box-shadow var(--v-mid) var(--v-ease);
}
select:hover:not(:disabled), select:focus { color: var(--inv-ink); box-shadow: inset 0 0 0 1px rgba(var(--c-glass-rgb), .2); }
select:focus-visible { outline: 2px solid rgb(var(--accent-rgb)); outline-offset: -2px; }
select option { background: var(--inv-solid); color: var(--inv-ink); }
label.field { display: grid; gap: 6px; min-width: 0; }
label.field > span:first-child, .field-label { color: var(--inv-ink-3); font-size: 12px; font-weight: 600; }
label.field small, .help { color: var(--inv-ink-3); font-size: 12px; font-weight: 500; }
label.field small code { overflow-wrap: anywhere; }
/* Recherche (SearchInput) : loupe dans le champ. */
.input-icon { position: relative; flex: 1 1 220px; min-width: 180px; max-width: 380px; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--inv-ink-3); pointer-events: none; }
.input-icon > input { padding-left: 38px; }
/* Case à cocher (BaseCheckbox) : 18 px, liseré 1,5 px, cochée = couleur d'action + coche. */
.check { display: inline-flex; align-items: center; gap: 12px; min-height: 32px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--inv-ink); user-select: none; }
.check input { appearance: none; width: 18px; height: 18px; background: transparent; box-shadow: inset 0 0 0 1.5px rgba(var(--c-glass-rgb), .3); display: grid; place-items: center; cursor: pointer; flex: none; margin: 0; padding: 0;
  transition: background .15s var(--v-ease), box-shadow .15s var(--v-ease); }
.check:hover input:not(:checked):not(:disabled) { box-shadow: inset 0 0 0 1.5px rgba(var(--c-glass-rgb), .55); }
.check input:checked { background: var(--inv-brand); box-shadow: none; }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--inv-on-brand); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible { outline: 2px solid rgb(var(--accent-rgb)); outline-offset: 2px; }
/* Curseur (inv-range / BaseSlider) : rail plat de 4 px, poignée carrée de 14 px qui grossit au survol. */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; padding: 0; background: transparent; cursor: pointer; outline: none; box-shadow: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--inv-gauge); }
input[type="range"]::-moz-range-track { height: 4px; background: var(--inv-gauge); }
input[type="range"]::-moz-range-progress { height: 4px; background: var(--inv-brand); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0;
  background: var(--inv-knob); box-shadow: 0 2px 6px rgba(var(--c-black-rgb), .5); transition: transform .12s var(--v-ease); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; background: var(--inv-knob); box-shadow: 0 2px 6px rgba(var(--c-black-rgb), .5); transition: transform .12s var(--v-ease); }
input[type="range"]:hover:not(:disabled)::-webkit-slider-thumb, input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:hover:not(:disabled)::-moz-range-thumb { transform: scale(1.12); }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid rgb(var(--accent-rgb)); outline-offset: 2px; }
input[type="range"]:disabled { opacity: .4; cursor: default; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; align-items: start; }

/* SegmentedControl : plaques carrées séparées de 6 px ; l'option choisie prend la couleur d'action. */
.seg { display: inline-flex; align-items: center; gap: 6px; }
.seg button {
  border: 0; background: var(--inv-plate); color: var(--inv-ink-2); font: 600 13px/1 var(--font); height: 34px; padding: 0 14px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--c-separator);
  transition: color var(--v-mid) var(--v-ease), background var(--v-mid) var(--v-ease), box-shadow var(--v-mid) var(--v-ease),
    transform var(--v-fast) var(--v-ease-press), filter var(--v-fast) var(--v-ease-press);
}
.seg button:hover:not(.on):not(:disabled) { color: var(--inv-ink); }
.seg button:active:not(:disabled) { transform: translateY(1px); filter: brightness(.9); }
.seg button.on { background: var(--inv-brand); color: var(--inv-on-brand); box-shadow: none; }
.seg button:disabled { opacity: .35; cursor: default; }
.seg button svg.ic { width: 16px; height: 16px; }

/* BaseSwitch : piste carrée 40 × 22, curseur carré de 16 px qui rebondit ; activé = couleur d'action. */
.toggle { position: relative; width: 40px; height: 22px; flex: none; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: rgba(var(--c-glass-rgb), .14); cursor: pointer; transition: background var(--v-mid) var(--v-ease); }
.toggle:hover input:not(:checked):not(:disabled) + span { background: rgba(var(--c-glass-rgb), .2); }
.toggle span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: var(--inv-knob); transition: transform var(--v-slow) var(--v-ease-back), background var(--v-mid) var(--v-ease); }
.toggle input:checked + span { background: var(--inv-brand); }
.toggle input:checked + span::before { transform: translateX(18px); background: var(--c-text); }
.toggle input:disabled + span { opacity: .4; cursor: default; }
.toggle input:focus-visible + span { outline: 1px solid rgba(var(--c-glass-rgb), .5); outline-offset: 2px; }

/* ══════════════ Étiquettes (StatusPill) et points d'état ══════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; white-space: nowrap; flex: none;
  background: rgba(var(--c-glass-rgb), .08); color: var(--inv-ink-2); font: 600 11.5px/1 var(--font); border: 0;
}
.badge svg.ic { width: 12px; height: 12px; }
.badge.ok { background: rgba(var(--c-stat-up-rgb), .14); color: var(--c-stat-up); }
.badge.accent { background: var(--inv-brand); color: var(--inv-on-brand); }
.badge.danger { background: rgba(var(--c-inv-danger-rgb), .14); color: var(--c-red-lighter); }
.badge.warn, .badge.amber { background: rgba(var(--c-orange-soft-rgb), .14); color: var(--inv-warn); }
.badge.blue { background: rgba(var(--c-blue-light-rgb), .14); color: var(--c-blue-lighter); }
.badge.violet { background: rgba(var(--c-violet-light-rgb), .14); color: var(--violet); }
.dot { width: 7px; height: 7px; background: var(--c-stat-up); display: inline-block; flex: none; }
.dot.off { background: rgba(var(--c-glass-rgb), .35); }
.dot.live { animation: pulse 1.8s ease-in-out infinite; }
.dot.warn { background: var(--inv-warn); }
.dot.danger { background: var(--c-stat-down); }
.dot.blue { background: var(--blue); }
@keyframes pulse { 50% { opacity: .45; } }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--inv-ink-2); white-space: nowrap; }
.role-chip { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px 0 8px; font-size: 12px; font-weight: 600; background: rgba(var(--c-glass-rgb), .08); white-space: nowrap; }
.role-chip i { width: 8px; height: 8px; display: inline-block; }
.kbd { font: 700 11.5px/1 var(--font); min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; background: var(--inv-keycap); color: var(--inv-keycap-ink); }

/* ══════════════ Tableaux ══════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 14px; box-shadow: inset 0 -1px 0 var(--c-separator); vertical-align: middle; }
th { color: var(--inv-ink-3); font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--inv-solid); height: 38px; }
td .badge, td .role-chip, td .pill, td .btn, td time { white-space: nowrap; }
td { font-size: 13px; font-weight: 500; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(var(--c-glass-rgb), .04); }
tr:last-child td { box-shadow: none; }
td.actions { text-align: right; white-space: nowrap; }
tr.click { cursor: pointer; }
td .sub { display: block; color: var(--inv-ink-3); font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user > div { min-width: 0; }
.cell-user b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* EmptyState (V4Empty) : plaque de 56 px, titre 14 px en encre forte, description 13,5 px. */
.empty { padding: 30px 20px; text-align: center; color: var(--inv-ink-3); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 500; line-height: 1.6; }
.empty .ring-ico { width: 56px; height: 56px; margin-bottom: 14px; display: grid; place-items: center; background: var(--inv-well); color: var(--inv-ink-3); }
.empty .ring-ico svg { width: 24px; height: 24px; stroke-width: 1.6; }
.empty b { color: var(--inv-ink); font: 600 14px/1.4 var(--font); margin-bottom: 4px; }
.empty > div:not(.ring-ico) { max-width: 360px; }
.empty > .btn, .empty > .row { margin-top: 14px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 12px; color: var(--inv-ink-3); font-size: 12.5px; font-weight: 600; }

/* ══════════════ Explorateur (arbre + contenu) ══════════════ */
.explorer { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: var(--page-h); }
.tree { box-shadow: inset -1px 0 0 var(--c-separator); padding: 16px 10px; position: sticky; top: 0; max-height: var(--page-h); overflow-y: auto; }
.tree .tree-title { padding: 0 10px 12px; display: flex; align-items: center; justify-content: space-between; }
.tree-node > .tn { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; cursor: pointer; color: var(--inv-ink-2); font-size: 13px; font-weight: 600; user-select: none; white-space: nowrap; }
.tree-node > .tn:hover { background: rgba(var(--c-glass-rgb), .06); color: var(--inv-ink); }
.tree-node > .tn.on { background: var(--inv-brand); color: var(--inv-on-brand); }
.tree-node > .tn.drop { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb)); }
.tree-node > .tn .tw { width: 16px; height: 16px; display: grid; place-items: center; color: var(--inv-ink-3); flex: none; transition: transform .15s; }
.tree-node > .tn .tw.open { transform: rotate(90deg); }
.tree-node > .tn .tw svg { width: 13px; height: 13px; }
.tree-node > .tn > svg.ic { width: 15px; height: 15px; }
.tree-children { padding-left: 12px; margin-left: 14px; box-shadow: inset 1px 0 0 var(--c-separator); }
.ex-main { min-width: 0; padding: 16px 16px 80px; }
.ex-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font: 700 19px var(--inv-title-font); flex: 1; min-width: 0; }
.crumbs a { color: var(--inv-ink-3); padding: 2px 6px; }
.crumbs a:hover { color: var(--inv-ink); background: rgba(var(--c-glass-rgb), .06); }
.crumbs a.cur { color: var(--inv-ink); }
.crumbs a.drop { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb)); }
.crumbs .sl { color: var(--faint); font-weight: 400; }
.ex-meta { color: var(--inv-ink-3); font-size: 12.5px; margin: -8px 0 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar select, .toolbar input[type="date"], .toolbar input[type="number"] { width: auto; min-width: 140px; max-width: 240px; flex: 0 1 auto; }
.toolbar > .btn, .toolbar > .seg, .toolbar > .check { flex: none; }
/* Intertitre de liste (pm-group-label). */
.section-label { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; color: var(--inv-ink-3); font-size: 12px; font-weight: 600; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--c-separator); }
.block-title { color: var(--inv-ink-3); font-size: 12px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.block-title::after { content: ""; flex: 1; height: 1px; background: var(--c-separator); }

.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 20px; }
.folder { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; background: var(--inv-plate); user-select: none; }
.folder.drop { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb)); }
.folder .fi { width: 40px; height: 40px; display: grid; place-items: center; background: var(--inv-well); color: var(--inv-ink-2); flex: none; }
.folder .fi svg { width: 18px; height: 18px; }
.folder .fn { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .fs { color: var(--inv-ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder > div:nth-child(2) { flex: 1; min-width: 0; }
.folder .more { margin-left: auto; opacity: 0; transition: opacity .15s; }
.folder:hover .more { opacity: 1; }

.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; }
.tile { background: var(--inv-plate); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; user-select: none; }
.tile.sel { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb)); }
.tile .pick { position: absolute; top: 8px; right: 8px; z-index: 2; opacity: 0; transition: opacity .12s; }
.tile:hover .pick, .tile.sel .pick, .selecting .tile .pick { opacity: 1; }
/* Case d'image (pm-icon-box agrandie) : fond sombre, image contenue. */
.thumb { aspect-ratio: 1; display: grid; place-items: center; position: relative; overflow: hidden; background: var(--inv-well); }
.thumb img { max-width: 88%; max-height: 88%; object-fit: contain; }
.thumb.cover img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.thumb .kind-ic { width: 34px; height: 34px; color: var(--faint); }
.thumb .tags { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; }
.tile .meta { padding: 10px 12px 12px; display: grid; gap: 3px; }
.tile .name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { display: flex; justify-content: space-between; color: var(--inv-ink-3); font-size: 11.5px; gap: 8px; }
.list-thumb { width: 44px; height: 44px; aspect-ratio: 1; }
.list-thumb .kind-ic { width: 18px; height: 18px; }

.selbar {
  position: fixed; left: 50%; bottom: 24px; z-index: 45; display: flex; align-items: center; gap: 8px; --tx: -50%; transform: translateX(-50%);
  padding: 8px 8px 8px 18px; background: var(--inv-pop); box-shadow: var(--inv-shadow), inset 0 0 0 1px rgba(var(--accent-rgb), .45);
  animation: rise .2s var(--inv-ease); max-width: calc(100vw - 32px); overflow-x: auto;
}
.selbar b { font: 700 13px var(--inv-title-font); white-space: nowrap; margin-right: 8px; }
.dropzone-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(var(--c-black-rgb), .78); display: grid; place-items: center; pointer-events: none; animation: fade .15s; }
.dropzone-overlay div { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb)); padding: 60px 80px; text-align: center; background: rgba(var(--accent-rgb), .12); }
.dropzone-overlay h2 { font-size: 24px; margin-bottom: 6px; }

/* ══════════════ Étapes, puces, aperçus ══════════════ */
.steps { display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; }
.step .num { width: 44px; height: 44px; display: grid; place-items: center; font: 700 16px var(--inv-title-font); background: var(--inv-plate); color: var(--inv-ink-3); }
.step.done .num { background: var(--inv-brand); color: var(--inv-on-brand); }
.step.active .num { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb)); color: var(--inv-ink); }
.step h3 { font-size: 15px; margin: 10px 0 4px; }
.step > div > p { color: var(--inv-ink-3); margin: 0 0 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; border: 0; background: rgba(var(--c-glass-rgb), .08); color: var(--inv-ink-2); font: 600 12px var(--font); cursor: pointer; white-space: nowrap;
  transition: color var(--v-mid) var(--v-ease), background var(--v-mid) var(--v-ease); }
.chip:hover { color: var(--inv-ink); background: rgba(var(--c-glass-rgb), .12); }
.chip:disabled { opacity: .4; cursor: default; }
.chip.on { background: var(--inv-brand); color: var(--inv-on-brand); }
.linkpreview { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--inv-field); font-family: var(--mono); font-size: 12.5px; overflow-x: auto; white-space: nowrap; }
.linkpreview .base { color: var(--inv-ink-3); }
.linkpreview .dest { color: rgb(var(--accent-rgb)); font-weight: 600; }
.linkpreview .file { color: var(--inv-ink); }
.drop { box-shadow: inset 0 0 0 1px rgba(var(--c-glass-rgb), .2); padding: 40px 24px; text-align: center; background: var(--inv-cell-empty); transition: box-shadow .15s, background .15s; }
.drop.over { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb)); background: rgba(var(--accent-rgb), .1); }
.drop .big-ico { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--inv-brand); color: var(--inv-on-brand); box-shadow: var(--inv-brand-shadow); }
.drop .big-ico svg { width: 24px; height: 24px; }
.drop h3 { font-size: 18px; margin-bottom: 6px; }
.drop p { color: var(--inv-ink-3); margin: 0 0 16px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.summary-grid > div { padding: 12px 14px; background: var(--inv-well); }
.summary-grid b { display: block; font: 700 20px var(--inv-title-font); font-variant-numeric: tabular-nums; }
.summary-grid span { color: var(--inv-ink-3); font-size: 12px; font-weight: 600; }
.paths { font-family: var(--mono); font-size: 12.5px; display: grid; gap: 4px; max-height: 260px; overflow: auto; padding: 4px; }
.paths div { display: flex; gap: 10px; padding: 6px 10px; background: var(--inv-cell); }
.paths .from { color: var(--inv-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.paths .to { color: rgb(var(--accent-rgb)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1.2; min-width: 0; }
/* Jauge plate (.gauge > i du kit). */
.progress { height: 4px; background: var(--inv-gauge); overflow: hidden; position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--inv-brand); transition: width var(--v-slow) var(--v-ease); }
.progress > i.err { background: var(--danger); }
.bar { height: 4px; background: var(--inv-gauge); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--inv-brand); transition: width var(--v-slow) var(--v-ease); }
.log { display: grid; gap: 4px; max-height: 340px; overflow: auto; font-size: 12.5px; }
.log div { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; background: var(--inv-cell); }
.log .p { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log .ok { color: var(--c-stat-up); }
.log .err { color: var(--danger); }
.log .skip { color: var(--inv-warn); }

/* ══════════════ Tiroir latéral (détail) ══════════════ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: var(--inv-backdrop); animation: fade .14s var(--v-ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); z-index: 51; background: var(--inv-solid);
  box-shadow: var(--inv-modal-shadow); display: flex; flex-direction: column; animation: drawer-in .26s var(--v-ease); }
.drawer header { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 8px 8px 16px; background: var(--inv-head); box-shadow: inset 0 -1px 0 var(--c-separator); }
.drawer header h2 { font: 700 19px/1.2 var(--inv-title-font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.drawer .body { overflow-y: auto; padding: 16px 18px 18px; display: grid; gap: 18px; align-content: start; grid-auto-rows: max-content; }
@keyframes drawer-in { from { opacity: 0; transform: translateX(16px); } }
.preview { overflow: hidden; background: var(--inv-well); }
.preview .thumb { aspect-ratio: auto; min-height: 240px; max-height: 380px; padding: 16px; }
.preview .thumb img { max-height: 348px; }
.preview video { width: 100%; display: block; background: rgb(var(--c-black-rgb)); }
.preview audio { width: 100%; display: block; padding: 14px; }
.links { display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.link-row .lbl { font-size: 12px; color: var(--inv-ink-3); font-weight: 600; }
.link-row input { font-family: var(--mono); font-size: 11.5px; height: 34px; }
/* Libellé / valeur (pm-caption / pm-value). */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--inv-ink-3); font-size: 12.5px; font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ══════════════ Graphiques et jauges ══════════════ */
.chart { position: relative; width: 100%; min-width: 0; overflow: hidden; }
.chart-in { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid line { stroke: var(--c-separator); stroke-width: 1; }
.chart .axis text { fill: var(--inv-ink-3); font-size: 11px; font-family: var(--font); font-weight: 600; }
.chart .tip { position: absolute; pointer-events: none; background: var(--inv-solid); color: var(--inv-ink-2); padding: 10px 12px; display: grid; gap: 4px; min-width: 150px;
  box-shadow: var(--inv-shadow), 0 0 0 1px rgba(var(--c-glass-rgb), .08);
  font-size: 12px; font-weight: 600; white-space: nowrap; transform: translate(-50%, -115%); z-index: 2; }
.chart .tip > b { display: block; margin-bottom: 2px; color: var(--inv-ink-3); font: 700 11.5px var(--font); }
.chart .tip .tr { display: flex; align-items: center; gap: 8px; }
.chart .tip .tr span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chart .tip .tr em { font-style: normal; font-weight: 700; color: var(--inv-ink); font-variant-numeric: tabular-nums; }
.chart .tip i { display: inline-block; width: 7px; height: 7px; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; font-weight: 600; color: var(--inv-ink-3); }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 7px; }
.gauge { display: flex; align-items: center; gap: 20px; }
.gauge .ringwrap { position: relative; width: 112px; height: 112px; flex: none; }
.gauge .ringwrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .ringwrap .pct { position: absolute; inset: 0; display: grid; place-items: center; font: 700 21px var(--inv-title-font); font-variant-numeric: tabular-nums; }
.gauge .ringwrap .pct small { display: block; font-size: 10px; color: var(--inv-ink-3); font-weight: 600; text-align: center; }
.gauge h3 { font-size: 15px; margin-bottom: 6px; }
.gauge .info { display: grid; gap: 3px; font-size: 13px; color: var(--inv-ink-3); }
.gauge .info b { color: var(--inv-ink); font-weight: 600; }
.stackbar { display: flex; height: 10px; overflow: hidden; background: var(--inv-gauge); gap: 2px; }
.stackbar i { display: block; height: 100%; }
.legend-list { display: grid; gap: 10px; margin-top: 16px; }
.legend-list div { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; font-size: 13px; }
.legend-list i { width: 10px; height: 10px; }

/* ══════════════ Onglets, encarts, code ══════════════ */
/* Onglets d'une fiche (TabStrip) : plaques séparées de 6 px, onglet actif à la couleur d'action. Avec tabsEl (.tabs.slide),
   un sélecteur unique GLISSE sous l'onglet actif (translation --v-ease, largeur --v-ease-stretch, --v-slow). */
.tabs { position: relative; display: flex; flex-wrap: wrap; gap: 6px; isolation: isolate; }
.tabs::-webkit-scrollbar { display: none; }
.tabs :is(button, .tab) {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 36px; min-width: 96px; padding: 0 16px; flex: none; border: 0;
  box-shadow: inset 0 0 0 1px var(--c-separator); background: var(--inv-plate); color: var(--inv-ink-2); font: 600 13px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: color var(--v-mid) var(--v-ease), transform var(--v-fast) var(--v-ease-press), filter var(--v-fast) var(--v-ease-press);
}
.tabs :is(button, .tab):hover:not(.on) { color: var(--inv-ink); }
.tabs :is(button, .tab):active:not(.on) { transform: translateY(1px); filter: brightness(.9); }
.tabs :is(button, .tab).on { background: var(--inv-brand); color: var(--inv-on-brand); box-shadow: var(--inv-brand-shadow); }
.tabs .cta-badge, .tabs .tab-count { min-width: 0; height: auto; padding: 0; background: none; color: var(--inv-ink-3); font: 700 12px/1 var(--font); font-style: normal; font-variant-numeric: tabular-nums; }
.tabs :is(button, .tab).on :is(.cta-badge, .tab-count) { background: none; color: var(--inv-on-brand); opacity: .72; }
/* Variante glissante : les plaques restent en place, le sélecteur passe dessous (ordre d'empilement dans .tabs). */
.tabs.slide > :is(button, .tab) { isolation: auto; z-index: auto; background: transparent; box-shadow: none; }
.tabs.slide > :is(button, .tab)::after { content: ""; position: absolute; inset: 0; z-index: -3; background: var(--inv-plate); box-shadow: inset 0 0 0 1px var(--c-separator); pointer-events: none; }
.tabs.slide > :is(button, .tab).on { background: transparent; box-shadow: none; }
.tabs.slide > :is(button, .tab).on::before { opacity: 0; }
.tabs.slide > .tab-sel { position: absolute; top: 0; left: 0; z-index: -2; width: 0; pointer-events: none; opacity: 0;
  background: var(--inv-brand); box-shadow: var(--inv-brand-shadow); }
.tabs.slide.ready > .tab-sel { transition: transform var(--v-slow) var(--v-ease), width var(--v-slow) var(--v-ease-stretch), opacity var(--v-mid); }
.tabs.slide > :is(button, .tab)::before { z-index: -1; }
.subnav { background: var(--inv-side); box-shadow: inset 0 -1px 0 var(--c-separator); padding: 8px 20px; }
.subnav .tabs { margin: 0; }
/* AlertBanner (inv-note) : boîte sombre neutre, icône colorée selon la variante (info, warn, danger, ok), texte 13 px. */
.callout { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 18px 16px;
  background: var(--inv-note); color: var(--inv-ink-2); font-size: 13px; font-weight: 500; line-height: 1.55; }
.callout > svg.ic { width: 18px; height: 18px; margin-top: 1px; color: var(--inv-ink-2); }
.callout:not(:has(> svg)) { grid-template-columns: minmax(0, 1fr); }
.callout > :not(svg) { grid-column: 2 / -1; min-width: 0; }
.callout:not(:has(> svg)) > * { grid-column: 1 / -1; }
.callout b { color: var(--inv-ink); font-weight: 600; }
.callout.warn > svg.ic { color: var(--inv-warn); }
.callout.danger > svg.ic { color: var(--danger); }
.callout.ok > svg.ic { color: var(--c-stat-up); }
pre.code { margin: 0; padding: 14px 16px; background: var(--inv-code); color: var(--inv-ink-2); font: 12.5px/1.65 var(--mono); overflow-x: auto; position: relative; }
pre.code .copy { position: absolute; right: 10px; top: 10px; }
.keyreveal { font-family: var(--mono); padding: 12px 14px; background: var(--inv-field); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); color: var(--inv-ink); overflow-wrap: anywhere; }
.endpoint { overflow: hidden; background: var(--inv-plate); }
.endpoint summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.endpoint summary::-webkit-details-marker { display: none; }
.endpoint summary:hover { background: rgba(var(--c-glass-rgb), .05); }
.endpoint .path { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.endpoint .desc { color: var(--inv-ink-3); font-size: 12px; margin-left: auto; text-align: right; }
.endpoint .inner { padding: 14px 16px; display: grid; gap: 10px; font-size: 13px; box-shadow: inset 0 1px 0 var(--c-separator); color: var(--inv-ink-2); }
.method { font: 700 10.5px var(--mono); padding: 3px 8px; min-width: 58px; text-align: center; }
.m-GET { background: rgba(var(--c-stat-up-rgb), .14); color: var(--c-stat-up); }
.m-POST { background: rgba(var(--c-blue-light-rgb), .16); color: var(--c-blue-lighter); }
.m-PUT, .m-PATCH { background: rgba(var(--c-orange-soft-rgb), .18); color: var(--inv-warn); }
.m-DELETE { background: rgba(var(--c-inv-danger-rgb), .22); color: var(--c-text); }
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.docnav { position: sticky; top: 16px; display: grid; gap: 4px; align-self: start; }
.docnav a { height: 38px; display: flex; align-items: center; padding: 0 12px; background: var(--inv-plate); color: var(--inv-ink-2); font-size: 13px; font-weight: 600; }
.docnav a:hover { color: var(--inv-ink); }
.docs-layout section { scroll-margin-top: 16px; }

/* ══════════════ Boîtes de dialogue (ModalBox) ══════════════ */
dialog { border: 0; background: var(--inv-solid); color: var(--inv-ink); padding: 0; width: min(540px, calc(100vw - 32px)); box-shadow: var(--inv-modal-shadow); max-height: calc(100vh - 48px); overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; animation: modal-in .18s var(--v-ease) backwards; }
dialog::backdrop { background: var(--inv-backdrop); animation: fade .14s var(--v-ease); }
dialog header { flex: none; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 8px 8px 16px; background: var(--inv-head); box-shadow: inset 0 -1px 0 var(--c-separator); font: 700 19px/1.2 var(--inv-title-font); }
dialog header .dlg-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 18px 18px; display: grid; gap: 16px; align-content: start; color: var(--inv-ink-2); font-size: 13px; line-height: 1.55; }
dialog footer { flex: none; padding: 0 18px 18px; display: flex; justify-content: flex-end; gap: 8px; }
dialog footer:empty { display: none; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ToastHost / UiToast (notice.css) : carte plaque de 320 px, barre de temps de 2,5 px en haut à la couleur du type,
   marque carrée teintée de 36 px, croix discrète ; entrée par la droite, sortie vers la droite. */
#toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 100; pointer-events: none; }
.toast { --vn-rgb: var(--c-notif-success-rgb); position: relative; width: 320px; max-width: calc(100vw - 24px); overflow: hidden; pointer-events: auto;
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 12px 12px; background: var(--inv-pop); color: var(--inv-ink);
  box-shadow: var(--inv-shadow), 0 0 0 1px rgba(var(--c-glass-rgb), .08); animation: toast-in .26s var(--v-ease) both; }
.toast.err { --vn-rgb: var(--c-notif-error-rgb); }
.toast.leaving { animation: toast-out .2s ease-in both; pointer-events: none; }
.toast .t-time { position: absolute; top: 0; left: 0; height: 2.5px; width: 100%; background: rgb(var(--vn-rgb)); box-shadow: 0 0 8px rgba(var(--vn-rgb), .65); animation: toast-drain linear forwards; }
.toast .t-mark { width: 36px; height: 36px; flex: none; display: grid; place-items: center; color: rgb(var(--vn-rgb)); background: rgba(var(--vn-rgb), .12); }
.toast .t-mark svg.ic { width: 18px; height: 18px; }
.toast .t-msg { flex: 1; min-width: 0; min-height: 36px; display: flex; align-items: center; margin: 0; font-size: 12.5px; font-weight: 500; line-height: 1.48; color: var(--inv-ink); overflow-wrap: anywhere; }
.toast .t-close { width: 24px; height: 24px; flex: none; display: grid; place-items: center; margin-top: -2px; padding: 0; border: 0; cursor: pointer;
  color: var(--inv-ink-3); background: rgba(var(--c-glass-rgb), .03); opacity: .6; transition: opacity .15s var(--v-ease), color .15s var(--v-ease); }
.toast .t-close:hover { opacity: 1; color: var(--inv-ink); }
.toast .t-close svg.ic { width: 13px; height: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(14px); } }
@keyframes toast-drain { from { width: 100%; } to { width: 0; } }

/* ══════════════ Connexion ══════════════ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); padding: var(--frame-pad); gap: 12px; }
.auth-form { display: grid; align-content: center; justify-items: center; padding: 80px 24px 32px; position: relative; background: var(--inv-panel); box-shadow: var(--inv-shadow); }
.brand { display: flex; align-items: center; color: var(--inv-ink); }
.brand .logo { height: 32px; width: auto; object-fit: contain; filter: var(--logo-filter); }
.auth-form .brand { position: absolute; top: 24px; left: 28px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 16px; }
.auth-card h1 { font-size: 36px; line-height: 1.05; }
.auth-card p { color: var(--inv-ink-3); margin: 0; font-size: 13.5px; }
.auth-visual { position: relative; overflow: hidden; display: grid; align-content: end; padding: 48px; background: var(--inv-panel); box-shadow: var(--inv-shadow);
  background-image: radial-gradient(circle at 85% 15%, rgba(var(--accent-rgb), .24), transparent 55%), radial-gradient(circle at 10% 100%, rgba(var(--accent-2-rgb), .22), transparent 55%); }
.auth-visual .auth-logo { position: absolute; top: 44px; left: 48px; height: 46px; width: auto; filter: var(--logo-filter); }
.auth-visual h2 { font-size: 42px; line-height: 1.05; max-width: 560px; }
.auth-visual h2 em { font-style: normal; color: rgb(var(--accent-rgb)); }
.auth-visual > p { color: var(--inv-ink-2); max-width: 480px; font-size: 14px; margin: 16px 0 0; }
.auth-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 28px; }
.auth-tiles div { background: var(--inv-plate); padding: 14px 16px; }
.auth-tiles b { display: block; font: 700 18px var(--inv-title-font); color: var(--inv-ink); }
.auth-tiles span { color: var(--inv-ink-3); font-size: 12px; font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--inv-ink-3); font-size: 12px; font-weight: 600; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--c-separator); }
.discord-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.discord-card .who { flex: 1; min-width: 180px; }
.discord-card .who b { display: block; font-size: 15px; }
.discord-card .who small { color: var(--inv-ink-3); }

.spin { width: 28px; height: 28px; flex: none; border: 3px solid rgba(var(--c-glass-rgb), .18); border-top-color: rgb(var(--accent-rgb)); animation: rot .8s linear infinite; display: inline-block; }
.spin.sm { width: 16px; height: 16px; border-width: 2px; }
.loading { padding: 80px; display: grid; place-items: center; }

@keyframes rot { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translate(var(--tx, 0), 8px); opacity: 0; } }

/* ── Changement de page : opacité seule ── */
#main.page-in > .page { animation: page-in .26s var(--inv-ease); }
/* Entrée des blocs d'une page : léger décalage en cascade (désactivé par les rafraîchissements silencieux). */
#main.page-in :is(.kpis > *, .dash-col > .card, .content > .stack > *, .content > .grid-2 > *, .content > .card) { animation: block-in .34s var(--inv-ease) both; }
#main.page-in .kpis > :nth-child(2), #main.page-in .dash-col:nth-child(2) > .card, #main.page-in .content > .stack > :nth-child(2) { animation-delay: .03s; }
#main.page-in .kpis > :nth-child(3), #main.page-in .dash-col:nth-child(3) > .card, #main.page-in .content > .stack > :nth-child(3) { animation-delay: .06s; }
#main.page-in .kpis > :nth-child(4), #main.page-in .content > .stack > :nth-child(4) { animation-delay: .09s; }
#main.page-in .content > .stack > :nth-child(n+5) { animation-delay: .12s; }
/* Rafraîchissement silencieux d'une page : pas d'animation d'entrée. */
.page.quiet :is(.kpis > *, .dash-col > .card, .chart rect.cbar, .chart path.ln, .chart path.area) { animation: none !important; }
.page.quiet .chart path.ln { stroke-dashoffset: 0; }
@keyframes block-in { from { opacity: 0; transform: translateY(6px); } }
/* Valeur mise à jour (rafraîchissement automatique) : bref éclat de la couleur d'action. */
.updated { animation: upd 1.2s var(--inv-ease); }
@keyframes upd { 0% { color: rgb(var(--accent-rgb)); } 100% { color: inherit; } }
/* Graphiques : barres qui montent, courbes qui se tracent, aires qui apparaissent. */
.chart rect.cbar { animation: bar-up .5s var(--inv-ease) both; }
.chart path.ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ln-draw .8s var(--inv-ease) forwards; }
.chart path.area { animation: fade .6s ease both; }
.chart .hover-col { fill: rgba(var(--c-glass-rgb), .05); }
@keyframes bar-up { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ln-draw { to { stroke-dashoffset: 0; } }
#main.page-busy { opacity: .55; transition: opacity .2s ease .12s; pointer-events: none; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
.route-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 120; background: rgb(var(--accent-rgb)); opacity: 0; transition: width .4s ease, opacity .25s ease; }
.route-bar.on { opacity: 1; width: 70%; transition: width 4s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
.route-bar.done { opacity: 0; width: 100%; transition: width .15s ease, opacity .3s ease .1s; }

.replace-box { display: grid; gap: 10px; }
.replace-box .help { margin: 0; }
.preview.drop { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb)); }

/* ══════════════ Composants propres au site ══════════════ */
.navmenu { position: fixed; min-width: 250px; z-index: 60; background: var(--inv-pop); box-shadow: var(--inv-shadow); padding: 6px; animation: fade .14s; }
.navmenu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--inv-ink-2); font-size: 13.5px; font-weight: 600; }
.navmenu a:hover { background: rgba(var(--c-glass-rgb), .07); color: var(--inv-ink); }
.navmenu a.active { background: var(--inv-brand); color: var(--inv-on-brand); }
.navmenu a small { display: block; color: var(--inv-ink-3); font-size: 11.5px; }

/* Palette de commandes (Ctrl+K) */
.palette-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(var(--c-black-rgb), .6); animation: fade .12s; }
.palette { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(660px, calc(100vw - 24px)); z-index: 91;
  background: var(--inv-pop); box-shadow: var(--inv-shadow); overflow: hidden; animation: fade .14s; }
.palette .pin { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; background: var(--inv-head); }
.palette .pin input { box-shadow: none; background: none; padding: 0; height: 100%; font-size: 15px; }
.palette .results { max-height: 52vh; overflow-y: auto; padding: 8px; display: grid; gap: 2px; }
.palette .res { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; cursor: pointer; color: var(--inv-ink-2); background: var(--inv-plate); }
.palette .res.on { background: var(--inv-brand); color: var(--inv-on-brand); }
.palette .res.on .t b, .palette .res.on .t small { color: var(--inv-on-brand); }
.palette .res .t { flex: 1; min-width: 0; }
.palette .res .t b { display: block; font-size: 13.5px; color: var(--inv-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette .res .t small { color: var(--inv-ink-3); font-size: 12px; }
.palette .group-title { padding: 10px 4px 4px; }

/* En-tête d'une fiche (joueur, entreprise…) */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: relative; }
.profile-head .big-avatar { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; flex: none;
  background: var(--inv-well); color: var(--inv-ink-2); font: 700 22px var(--inv-title-font); }
.profile-head .big-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head h1 { font-size: clamp(22px, 2.4vw, 30px); }
.profile-head .meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--inv-ink-3); font-size: 12.5px; font-weight: 600; margin-top: 6px; align-items: center; }

/* Statistiques compactes */
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; }
.mini { padding: 12px 14px; background: var(--inv-well); min-width: 0; }
.mini b { display: block; font: 700 19px var(--inv-title-font); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini span { color: var(--inv-ink-3); font-size: 12px; font-weight: 600; }

/* Grille d'inventaire (cases du F1 : --inv-cell) */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.inv-slot { background: var(--inv-cell); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; }
.inv-slot .thumb { aspect-ratio: 1; background: transparent; }
.inv-slot .thumb img { max-width: 76%; max-height: 76%; }
.inv-slot .qty { position: absolute; top: 6px; right: 6px; font-size: 11.5px; font-weight: 700; padding: 0 6px; height: 20px; display: grid; place-items: center;
  background: rgba(var(--c-black-rgb), .55); color: var(--c-text); font-variant-numeric: tabular-nums; }
.inv-slot .nm { padding: 8px 10px; font-size: 12px; font-weight: 600; background: var(--inv-well); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-slot .nm small { display: block; color: var(--inv-ink-3); font-weight: 500; font-size: 11px; }

/* Cartes d'objets (véhicules, entreprises) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 8px; }
.ocard { background: var(--inv-plate); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.ocard .body, .ocard .row, .ocard .row > * { min-width: 0; }
.ocard .thumb { aspect-ratio: 16 / 9; }
.ocard .thumb img { max-width: 86%; max-height: 86%; }
.ocard .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.ocard .body b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard .body small { color: var(--inv-ink-3); font-size: 12px; font-weight: 500; }
.ocard .banner { height: 72px; background: var(--inv-well) center / cover no-repeat; }

/* Visionneuse / éditeur JSON */
.json-view { font: 12px/1.6 var(--mono); background: var(--inv-code); padding: 12px 14px; overflow: auto; max-height: 420px; white-space: pre; color: var(--inv-ink-2); }
.json-view .k { color: var(--c-blue-lighter); }
.json-view .s { color: var(--c-stat-up); }
.json-view .n { color: var(--inv-warn); }
.json-view .b { color: var(--violet); }
textarea.json-edit { min-height: 260px; }

/* Formulaires d'édition */
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding-top: 6px; }
.dirty-bar { position: sticky; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; margin-top: 16px;
  background: var(--inv-pop); box-shadow: var(--inv-shadow), inset 0 0 0 1px rgba(var(--accent-rgb), .45); animation: rise .2s var(--inv-ease); }
.dirty-bar b { font: 700 13px var(--inv-title-font); flex: 1; }

/* Résultat d'une action en jeu */
.action-result { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--inv-cell); }
.action-result.ok { background: rgba(var(--c-stat-up-rgb), .12); }
.action-result.ok > svg { color: var(--c-stat-up); }
.action-result.err { background: rgba(var(--c-inv-danger-rgb), .18); }
.action-result.err > svg { color: var(--danger); }
.flash-result { display: grid; gap: 4px; animation: block-in .2s ease-out both; }
.flash-result.leaving { animation: flash-out .2s ease-in both; pointer-events: none; }
@keyframes flash-out { to { opacity: 0; transform: translateY(-4px); } }

/* Grilles d'actions (case d'icône + libellé) */
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 6px; }
.action-btn { display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; background: var(--inv-plate); cursor: pointer; color: var(--inv-ink); text-align: left; font: inherit; }
.action-btn .ai { width: 40px; height: 40px; display: grid; place-items: center; background: var(--inv-well); color: var(--inv-ink-2); flex: none; }
.action-btn.danger .ai { background: rgba(var(--c-inv-danger-rgb), .3); color: var(--c-text); }
.action-btn.accent .ai { background: var(--inv-brand); color: var(--inv-on-brand); }
.action-btn b { display: block; font-size: 13px; font-weight: 600; }
.action-btn small { color: var(--inv-ink-3); font-size: 11.5px; font-weight: 500; }
.action-btn:disabled { opacity: .45; cursor: default; }

/* Carte (Leaflet) */
.map-page { display: grid; grid-template-columns: minmax(0, 1fr) 330px; height: var(--page-h); min-height: 520px; }
.map-wrap { position: relative; min-height: 520px; background: rgb(var(--c-night-950-rgb)); }
.map-wrap .leaflet-container { position: absolute; inset: 0; background: rgb(var(--c-night-950-rgb)); font-family: var(--font); }
.map-side { box-shadow: inset 1px 0 0 var(--c-separator); padding: 16px; overflow-y: auto; max-height: var(--page-h); display: grid; gap: 14px; align-content: start; }
.leaflet-control-zoom a { background: var(--inv-plate) !important; color: var(--inv-ink) !important; border: 0 !important; }
.leaflet-bar { border: 0 !important; overflow: hidden; box-shadow: var(--inv-shadow) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--inv-pop) !important; color: var(--inv-ink) !important; box-shadow: var(--inv-shadow) !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 13px; }
.leaflet-tooltip { background: var(--inv-solid) !important; color: var(--inv-ink) !important; border: 0 !important; box-shadow: var(--inv-shadow) !important; font-size: 12px; font-weight: 600; }
.leaflet-tooltip::before { display: none; }
.map-player { width: 14px; height: 14px; border: 2px solid var(--c-text); box-shadow: 0 0 10px rgba(var(--c-black-rgb), .6); }
.map-coords { position: absolute; left: 12px; bottom: 12px; z-index: 500; font: 600 11.5px var(--mono); padding: 6px 10px; background: var(--inv-pop); }
.sprite-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; max-height: 340px; overflow-y: auto; }
.sprite-grid button { aspect-ratio: 1; border: 0; background: var(--inv-cell); display: grid; place-items: center; cursor: pointer; padding: 6px; }
.sprite-grid button:hover { background: rgba(var(--c-glass-rgb), .1); }
.sprite-grid button.on { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb)); }
.sprite-grid img { width: 100%; height: 100%; object-fit: contain; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.color-swatches button { width: 26px; height: 26px; border: 0; cursor: pointer; }
.color-swatches button.on { box-shadow: 0 0 0 2px var(--inv-ink); }

/* Permissions (cases par groupe) */
.perm-groups { display: grid; gap: 12px; }
.perm-group { overflow: hidden; background: var(--inv-plate); }
.perm-group > header { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px; background: var(--inv-head); }
.perm-group > header b { font: 700 15px var(--inv-title-font); flex: 1; }
.perm-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; box-shadow: inset 0 -1px 0 var(--c-separator); }
.perm-row:last-child { box-shadow: none; }
.perm-row b { font-size: 13px; font-weight: 600; display: block; }
.perm-row small { color: var(--inv-ink-3); font-size: 12px; }

/* Double authentification */
.mfa-card { width: min(440px, 100%); display: grid; gap: 16px; }
.qr { width: 196px; height: 196px; padding: 10px; background: var(--c-text); display: grid; place-items: center; }
.qr img, .qr canvas, .qr svg { width: 100%; height: 100%; image-rendering: pixelated; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; font-family: var(--mono); font-size: 13px; }
.codes span { padding: 8px 10px; background: var(--inv-cell); text-align: center; }
input.otp { height: 56px; font: 600 24px var(--mono); letter-spacing: .4em; text-align: center; }

/* Fil d'activité */
.feed { display: grid; }
.feed-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 14px; box-shadow: inset 0 -1px 0 var(--c-separator); }
.feed-item:last-child { box-shadow: none; }
.feed-item .fi { width: 34px; height: 34px; display: grid; place-items: center; background: var(--inv-well); color: var(--inv-ink-2); }
.feed-item .fi.ok { background: rgba(var(--c-stat-up-rgb), .14); color: var(--c-stat-up); }
.feed-item .fi.err { background: rgba(var(--c-inv-danger-rgb), .22); color: var(--c-text); }
.feed-item .ft { min-width: 0; font-size: 13px; }
.feed-item .ft b { font-weight: 600; }
.feed-item .ft small { display: block; color: var(--inv-ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item time { color: var(--inv-ink-3); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* Chargement squelette */
.skel { background: linear-gradient(90deg, var(--inv-cell), rgba(var(--c-glass-rgb), .1), var(--inv-cell)); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
@keyframes skel { to { background-position: -200% 0; } }

/* Tableau de bord : tient sur un écran (colonnes en flex, cartes « grow » qui défilent dans leur corps). */
.content.dash { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; }
.content.dash > .kpis { margin: 0; flex: none; }
.dash-grid { flex: 1; min-height: 520px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dash-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.dash-col > .card { flex: none; display: flex; flex-direction: column; min-height: 0; }
.dash-col > .card.grow { flex: 1 1 0; min-height: 160px; }
.card.grow > .scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.card-tabs { padding: 8px 12px; box-shadow: inset 0 -1px 0 var(--c-separator); flex: none; }
.card-tabs .tabs :is(button, .tab) { height: 30px; min-width: 0; padding: 0 12px; gap: 8px; font-size: 12.5px; }
.card-head .seg { gap: 4px; }
.card-head .seg button { height: 30px; padding: 0 12px; font-size: 12.5px; }
.svc-list { padding: 8px; }
.feed-item .ft > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tableau de bord : état des services */
.svc-list { display: grid; gap: 4px; }
.svc { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px 6px 6px; background: var(--inv-cell); }
.svc .si { width: 34px; height: 34px; display: grid; place-items: center; background: var(--inv-well); color: var(--inv-ink-2); }
.svc b { display: block; font-size: 13px; font-weight: 600; }
.svc small { display: block; color: var(--inv-ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc > div { min-width: 0; }
.bars { display: grid; gap: 8px; padding: 14px 16px; }
.bars .br { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 22px; font-size: 12px; font-weight: 600; }
.bars .br span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--inv-ink-2); }
.bars .br .track { height: 10px; background: var(--inv-gauge); }
.bars .br .track i { display: block; height: 100%; background: var(--inv-brand); animation: bar-grow .6s var(--v-ease) both; transform-origin: left; }
.bars .br b { min-width: 56px; text-align: right; font-weight: 700; color: var(--inv-ink); font-variant-numeric: tabular-nums; }
@keyframes bar-grow { from { transform: scaleX(0); } }
.page.quiet .bars .br .track i { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ══════════════ Écrans réduits ══════════════ */
@media (max-width: 1280px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; }
  .dash-col { min-height: 0; }
  .dash-col > .card.grow { flex: none; }
  .card.grow > .scroll { max-height: 360px; }
}
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .explorer { grid-template-columns: 1fr; }
  .tree { display: none; }
  .map-page { grid-template-columns: 1fr; height: auto; }
  .map-wrap { min-height: 70vh; }
  .map-side { box-shadow: inset 0 1px 0 var(--c-separator); max-height: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  /* Bloc de gauche : panneau escamotable par-dessus la page, ouvert depuis la barre mobile. */
  .mobile-bar { display: flex; align-items: center; gap: 10px; height: 52px; flex: none; padding: 0 12px;
    background: var(--inv-side); box-shadow: inset 0 -1px 0 var(--c-separator); }
  .mobile-bar .logo { height: 24px; width: auto; filter: var(--logo-filter); }
  .mobile-bar .spacer { flex: 1; }
  .side { position: fixed; z-index: 80; top: 0; left: 0; bottom: 0; width: min(300px, 88vw); height: auto;
    box-shadow: var(--inv-shadow); transform: translateX(-105%); transition: transform .22s var(--inv-ease); }
  .side.open { transform: none; }
  .side-backdrop { position: fixed; inset: 0; z-index: 79; background: rgba(var(--c-black-rgb), .55); animation: fade .15s; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .docs-layout { grid-template-columns: 1fr; }
  .docnav { position: static; display: flex; flex-wrap: wrap; }
  .grid-2 { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .hero.left p { white-space: normal; }
}
@media (max-width: 640px) {
  .hero.left { flex-wrap: wrap; padding: 10px 12px; }
  .hero.left > div:first-child { flex-basis: 100%; }
  .hero.left h1, .hero.left p { white-space: normal; }
  .page > .content { padding: 12px; }
  .hero { padding: 24px 14px; }
  .hero.left { padding: 12px 14px; }
  .content { padding: 12px 12px 40px; }
  .ex-main { padding: 12px 12px 100px; }
  .files-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .link-row .lbl { grid-column: 1 / -1; }
  .kv { grid-template-columns: 1fr; gap: 2px 14px; }
  .kv dd { margin-bottom: 8px; }
  .step { grid-template-columns: 1fr; }
  .step .num { display: none; }
  .crumbs { font-size: 16px; }
  .seg { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; }
  .card-head { padding: 8px 12px; }
  .card-pad { padding: 12px; }
  .kpis { gap: 8px; }
  .stack, .grid-2 { gap: 8px; }
  .hero.left .hero-actions, .hero.left > .row { width: 100%; }
  .toolbar > * { flex: 1 1 auto; }
  .toolbar .input-icon { flex-basis: 100%; }
  .folders { grid-template-columns: 1fr; }
  .drawer header { padding: 8px 10px 8px 14px; }
  .drawer .body { padding: 14px; gap: 16px; }
  .preview .thumb { min-height: 200px; }
  dialog { width: calc(100vw - 24px); }
  dialog header { padding: 8px 8px 8px 14px; }
  dialog .body { padding: 14px; }
  dialog footer { padding: 0 16px 16px; flex-wrap: wrap; }
  dialog footer .btn { flex: 1 1 auto; }
  #toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  #toasts > * { width: auto; max-width: none; }
  table { font-size: 12.5px; }
  th, td { padding-left: 12px; padding-right: 12px; }
  .subnav { padding: 8px 12px; position: static; }
  .profile-head .big-avatar { width: 52px; height: 52px; }
  .feed-item { grid-template-columns: 36px minmax(0, 1fr); }
  .feed-item time { grid-column: 2; }
  .perm-row { grid-template-columns: auto minmax(0, 1fr); }
  .perm-row > :last-child { grid-column: 2; }
  .auth-card h1 { font-size: 28px; }
  .bars .br { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) auto; }
}
@media (max-width: 380px) {
  .files-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
}
