/* =====================================================================
   NViNiO•Share™ — Design System v4 « Aurora Glass »
   ---------------------------------------------------------------------
   · Glassmorphism : surfaces translucides + flou d'arrière-plan sur un
     fond « aurore » qui épouse la couleur du thème choisi
   · 10 thèmes de couleur : chaque palette = 3 variables (--p, --pd, --p2)
     d'où dérivent TOUS les accents (clair, sombre, dégradés, fonds teintés)
   · Modes clair / sombre / auto, contrastes WCAG AA vérifiés
   · Toutes les classes historiques sont conservées (pages + JS inchangés)
   ===================================================================== */

/* ------------------------------------------------------------ Jetons */
:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --fs-2xs: 11.5px; --fs-xs: 12.5px; --fs-sm: 13.5px; --fs-md: 14.5px;
  --fs-lg: 16px;    --fs-xl: 18px;   --fs-2xl: 21px;  --fs-3xl: 26px; --fs-4xl: 34px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px;

  --r-xs: 8px; --r-sm: 11px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;
  --r-pill: var(--r-full);
  --radius: var(--r-md); --radius-lg: var(--r-lg); --radius-xl: var(--r-xl);

  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --transition: var(--dur-2) var(--ease);
  --transition-fast: var(--dur-1) var(--ease);

  --sidebar-w: 284px;
  --topbar-h: 64px;
  --blur: 18px;

  /* ---- Palette par défaut : émeraude. Une palette = 3 couleurs.
         --p  : couleur en mode clair   --pd : couleur en mode sombre
         --p2 : teinte complémentaire pour les dégradés / l'aurore */
  --p: #0e9f6e; --pd: #34d399; --p2: #06b6d4;

  /* v3.1.1 — CONTRASTE : #dc2626 sur le fond teinté du bouton « vider la
     corbeille » ne montait qu'à 4,07:1 (WCAG AA exige 4,5:1). */
  --danger: #b81c1c; --danger-hover: #9e1717; --danger-strong: #b91c1c;
  --danger-soft: rgba(220, 38, 38, .11);
  --warning: #b45309; --warning-soft: rgba(217, 119, 6, .14);
  /* v3.1.1 — CONTRASTE : #6d4fe0 sur le fond teinté ne montait qu'à 4,4:1
     (WCAG AA exige 4,5:1 pour un texte de 12 px). On assombrit le ton. */
  --info: #5b3fd0;    --info-soft: rgba(109, 79, 224, .12);
  --success: var(--accent); --success-soft: var(--accent-soft);

  /* Couleurs de graphiques (catégorielles) — la 1re suit le thème */
  --chart-1: var(--accent); --chart-2: var(--p2);
  --chart-3: #f59e0b; --chart-4: #ec4899; --chart-5: #8b5cf6;
  --chart-6: #14b8a6; --chart-7: #f97316; --chart-8: #64748b;
}

/* ---- Thèmes de couleur (choix utilisateur) ------------------------- */
html[data-palette="emerald"]  { --p: #0e9f6e; --pd: #34d399; --p2: #06b6d4; }
html[data-palette="teal"]     { --p: #0d9488; --pd: #2dd4bf; --p2: #3b82f6; }
html[data-palette="ocean"]    { --p: #2563eb; --pd: #60a5fa; --p2: #06b6d4; }
html[data-palette="indigo"]   { --p: #4f46e5; --pd: #818cf8; --p2: #a855f7; }
html[data-palette="violet"]   { --p: #7c3aed; --pd: #a78bfa; --p2: #ec4899; }
html[data-palette="fuchsia"]  { --p: #c026d3; --pd: #e879f9; --p2: #f43f5e; }
html[data-palette="rose"]     { --p: #e11d48; --pd: #fb7185; --p2: #f97316; }
html[data-palette="orange"]   { --p: #ea580c; --pd: #fb923c; --p2: #eab308; }
html[data-palette="amber"]    { --p: #d97706; --pd: #fbbf24; --p2: #ef4444; }
html[data-palette="graphite"] { --p: #475569; --pd: #94a3b8; --p2: #0ea5e9; }

/* ---- Mode clair (défaut) ------------------------------------------- */
:root {
  --accent: var(--p);
  --accent-hover: color-mix(in srgb, var(--p) 86%, #000);
  --accent-strong: color-mix(in srgb, var(--p) 78%, #000);
  --accent-text: color-mix(in srgb, var(--p) 64%, #000);
  --accent-soft: color-mix(in srgb, var(--p) 15%, transparent);
  --accent-softer: color-mix(in srgb, var(--p) 8%, transparent);
  --accent-contrast: #ffffff;
  --accent-2: var(--p2);
  --grad: linear-gradient(135deg, var(--accent-strong), color-mix(in srgb, var(--p2) 22%, var(--accent-strong)));
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--p) 18%, transparent), color-mix(in srgb, var(--p2) 14%, transparent));

  --bg: color-mix(in srgb, var(--p) 4%, #f3f5f9);
  --bg-elevated: #ffffff;
  --bg-sunken: color-mix(in srgb, var(--p) 5%, #eaeef3);
  --bg-hover: rgba(15, 23, 42, .05);
  --bg-active: rgba(15, 23, 42, .09);
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .84);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .85);
  --field-bg: rgba(255, 255, 255, .72);
  --text: #0f172a;
  --text-soft: #475569;
  --text-faint: #5a6679;
  --border: rgba(15, 23, 42, .09);
  --border-strong: rgba(15, 23, 42, .17);
  --overlay: rgba(15, 23, 42, .45);
  --scroll-thumb: rgba(15, 23, 42, .2);
  --topbar-bg: rgba(255, 255, 255, .66);
  --sidebar-bg: rgba(255, 255, 255, .66);
  /* v3.1.1 — couleur de la marque « partagé avec moi » (violet, distincte de
     l'accent de thème : un élément partagé ne doit jamais être confondu avec
     un élément possédé). */
  --share: #6d28d9;
  --share-text: #5b21b6;
  --share-soft: rgba(109, 40, 217, .12);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .09);
  --shadow-lg: 0 6px 16px rgba(15, 23, 42, .09), 0 28px 64px rgba(15, 23, 42, .18);
  --glow: 0 8px 28px color-mix(in srgb, var(--p) 32%, transparent);
  --ring: 0 0 0 3px var(--accent-soft);
  --hero-glow-1: color-mix(in srgb, var(--p) 18%, transparent);
  --hero-glow-2: color-mix(in srgb, var(--p2) 12%, transparent);
  --aurora-op: .9;
  color-scheme: light;
}

/* ---- Mode sombre --------------------------------------------------- */
html[data-theme="dark"] {
  --accent: var(--pd);
  --accent-hover: color-mix(in srgb, var(--pd) 82%, #fff);
  --accent-strong: var(--pd);
  --accent-text: color-mix(in srgb, var(--pd) 58%, #fff);
  --accent-soft: color-mix(in srgb, var(--pd) 19%, transparent);
  --accent-softer: color-mix(in srgb, var(--pd) 10%, transparent);
  --accent-contrast: #05100c;
  --accent-2: color-mix(in srgb, var(--p2) 70%, #fff);
  --grad: linear-gradient(135deg, var(--pd), color-mix(in srgb, var(--p2) 40%, var(--pd)));
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--pd) 22%, transparent), color-mix(in srgb, var(--p2) 16%, transparent));

  --bg: color-mix(in srgb, var(--p) 5%, #080b10);
  --bg-elevated: #121821;
  --bg-sunken: #0c1117;
  --bg-hover: rgba(255, 255, 255, .06);
  --bg-active: rgba(255, 255, 255, .105);
  --glass: rgba(22, 29, 39, .56);
  --glass-strong: rgba(18, 24, 33, .82);
  --glass-border: rgba(255, 255, 255, .09);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .06);
  --field-bg: rgba(255, 255, 255, .045);
  --text: #eef2f7;
  --text-soft: #a9b4c3;
  --text-faint: #8d99a9;
  --border: rgba(255, 255, 255, .085);
  --border-strong: rgba(255, 255, 255, .16);
  --overlay: rgba(2, 5, 9, .66);
  --scroll-thumb: rgba(255, 255, 255, .18);
  --topbar-bg: rgba(14, 19, 27, .62);
  --sidebar-bg: rgba(14, 19, 27, .62);
  --share: #c4b5fd;
  --share-text: #ddd6fe;
  --share-soft: rgba(167, 139, 250, .2);
  --danger: #f06060; --danger-hover: #f78787; --danger-strong: #b91c1c;
  --warning: #f5a524; --warning-soft: rgba(245, 165, 36, .16);
  --info: #a995fb; --info-soft: rgba(169, 149, 251, .17);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .45);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, .5), 0 30px 70px rgba(0, 0, 0, .62);
  --glow: 0 8px 30px color-mix(in srgb, var(--pd) 26%, transparent);
  --hero-glow-1: color-mix(in srgb, var(--pd) 20%, transparent);
  --hero-glow-2: color-mix(in srgb, var(--p2) 14%, transparent);
  --aurora-op: .75;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --accent: var(--pd);
    --accent-hover: color-mix(in srgb, var(--pd) 82%, #fff);
    --accent-strong: var(--pd);
    --accent-text: color-mix(in srgb, var(--pd) 58%, #fff);
    --accent-soft: color-mix(in srgb, var(--pd) 19%, transparent);
    --accent-softer: color-mix(in srgb, var(--pd) 10%, transparent);
    --accent-contrast: #05100c;
    --accent-2: color-mix(in srgb, var(--p2) 70%, #fff);
    --grad: linear-gradient(135deg, var(--pd), color-mix(in srgb, var(--p2) 40%, var(--pd)));
    --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--pd) 22%, transparent), color-mix(in srgb, var(--p2) 16%, transparent));
    --bg: color-mix(in srgb, var(--p) 5%, #080b10);
    --bg-elevated: #121821;
    --bg-sunken: #0c1117;
    --bg-hover: rgba(255, 255, 255, .06);
    --bg-active: rgba(255, 255, 255, .105);
    --glass: rgba(22, 29, 39, .56);
    --glass-strong: rgba(18, 24, 33, .82);
    --glass-border: rgba(255, 255, 255, .09);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .06);
    --field-bg: rgba(255, 255, 255, .045);
    --text: #eef2f7;
    --text-soft: #a9b4c3;
    --text-faint: #8d99a9;
    --border: rgba(255, 255, 255, .085);
    --border-strong: rgba(255, 255, 255, .16);
    --overlay: rgba(2, 5, 9, .66);
    --scroll-thumb: rgba(255, 255, 255, .18);
    --topbar-bg: rgba(14, 19, 27, .62);
    --sidebar-bg: rgba(14, 19, 27, .62);
    --danger: #f06060; --danger-hover: #f78787; --danger-strong: #b91c1c;
    --warning: #f5a524; --warning-soft: rgba(245, 165, 36, .16);
    --info: #a995fb; --info-soft: rgba(169, 149, 251, .17);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .45);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, .5), 0 30px 70px rgba(0, 0, 0, .62);
    --glow: 0 8px 30px color-mix(in srgb, var(--pd) 26%, transparent);
    --hero-glow-1: color-mix(in srgb, var(--pd) 20%, transparent);
    --hero-glow-2: color-mix(in srgb, var(--p2) 14%, transparent);
    --aurora-op: .75;
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------ Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: linear-gradient(168deg, color-mix(in srgb, var(--p) 7%, var(--bg)) 0%, var(--bg) 46%, color-mix(in srgb, var(--p2) 6%, var(--bg)) 100%); background-attachment: fixed; }
/* v3.3.0 — NAVIGATION PLUS FLUIDE : transitions de vue inter-documents
   (Chrome/Edge 126+, progressive enhancement sans risque ailleurs) :
   le passage d'une page à l'autre (tableau de bord ↔ fichiers ↔ notes…)
   est animé par un fondu court au lieu d'un blanc sec — la navigation
   paraît nettement plus rapide. Désactivé si « réduire les animations ». */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
body {
  margin: 0; font-family: var(--font-sans); font-size: 14.5px; line-height: 1.55;
  color: var(--text); background: transparent; min-height: 100vh;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
img, svg, video { max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .45em; font-weight: 720; letter-spacing: -.02em; line-height: 1.22; }
h1 { font-size: 26px; } h2 { font-size: 21px; } h3 { font-size: 16px; } h4 { font-size: 14.5px; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
code { font-family: var(--font-mono); font-size: .92em; background: var(--bg-sunken); padding: 2px 6px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
*::-webkit-scrollbar-track { background: transparent; }

/* Fond « aurore » : 3 masses de dégradés douces, teintées par le thème.
   Pas de filter:blur() (coûteux) — les dégradés radiaux sont déjà diffus. */
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; will-change: transform; }
body::before {
  inset: -20vmax;
  background:
    radial-gradient(30vmax 26vmax at 3% 92%, color-mix(in srgb, var(--p2) 16%, transparent), transparent 70%),
    radial-gradient(38vmax 32vmax at 12% 8%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(34vmax 30vmax at 92% 14%, color-mix(in srgb, var(--p2) 19%, transparent), transparent 70%),
    radial-gradient(40vmax 34vmax at 70% 98%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 72%);
  opacity: var(--aurora-op);
  animation: nvAurora 38s ease-in-out infinite alternate;
}
body::after {
  inset: 0; opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 72%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 72%);
}
@keyframes nvAurora {
  /* v3.1.1 — PERFORMANCES : l'animation n'utilisait QUE translate/rotate/scale.
     Le `scale` force le navigateur à REDESSINER (rasteriser) un dégradé de
     140 % du viewport à CHAQUE image : le thread de rendu saturait et le logo
     flottant (et toute la page) saccadait sur mobile et sur portable modeste.
     → translation seule : la couche est rasterisée UNE fois puis déplacée par
     le compositeur, sans aucun redessin. */
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(2.5vw, 2vh, 0); }
  100% { transform: translate3d(-2vw, 3vh, 0); }
}

/* ------------------------------------------------------------ Utilitaires */
.max-h-scroll { max-height: 24rem; overflow-y: auto; }
.text-soft { color: var(--text-soft); } .text-faint { color: var(--text-faint); }
.text-danger { color: var(--danger); } .text-accent { color: var(--accent-text); } .text-warning { color: var(--warning); }
.mono { font-family: var(--font-mono); font-size: .93em; }
.nowrap { white-space: nowrap; } .w-100 { width: 100%; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.section { margin-bottom: 24px; }
.cluster { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.cluster.center { justify-content: center; }
.truncate { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
@media (min-width: 901px) { .show-mobile { display: none !important; } }
.section-eyebrow, .page-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2xs); font-weight: 720;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px;
}
.section-title { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 9px; letter-spacing: -.015em; }
.section-title .icon { width: 17px; height: 17px; color: var(--accent-text); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------ Icônes & boutons */
.icon-tile {
  width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-soft); color: var(--accent); flex: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
.icon-tile .icon { width: 18px; height: 18px; }
.icon-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.icon-tile.accent { background: var(--accent-soft); color: var(--accent); }
.icon-tile.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.icon-tile.warning { background: var(--warning-soft); color: var(--warning); box-shadow: none; }
.icon-tile-lg { width: 46px; height: 46px; border-radius: 14px; } .icon-tile-lg .icon { width: 22px; height: 22px; }
.icon-tile-xl { width: 56px; height: 56px; border-radius: 17px; } .icon-tile-xl .icon { width: 27px; height: 27px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 12px; border: 0; background: transparent; color: var(--text-soft); cursor: pointer;
  position: relative; flex: none; transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { transform: scale(.93); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn .icon { width: 19px; height: 19px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 17px;
  border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 620;
  font-size: 14px; line-height: 1.2; color: var(--text); background: transparent; min-height: 40px;
  letter-spacing: -.005em; -webkit-tap-highlight-color: transparent; user-select: none; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--dur-1) var(--ease);
}
.btn:hover:not(:disabled) { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring), 0 0 0 1px var(--accent); }
.btn .icon { width: 17px; height: 17px; flex: none; }
.btn-primary {
  background: var(--grad); color: var(--accent-contrast); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(15, 23, 42, .16), 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent);
  background-size: 140% 100%; background-position: 0 0;
}
.btn-primary:hover:not(:disabled) { background-position: 100% 0; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 4px rgba(15, 23, 42, .16), 0 10px 26px color-mix(in srgb, var(--accent) 38%, transparent); }
.btn-secondary { background: var(--glass); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-secondary:hover:not(:disabled) { background: var(--glass-strong); border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); transform: translateY(-1px); }
.btn-quiet { background: var(--bg-sunken); border-color: var(--border); color: var(--text-soft); }
.btn-quiet:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: var(--shadow-sm); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; min-height: 34px; border-radius: 10px; } .btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { padding: 13px 26px; font-size: 15.5px; min-height: 50px; border-radius: var(--r-md); }
.btn-icon { padding: 0; width: 40px; height: 40px; border-radius: 12px; flex: none; }
.btn-icon.btn-sm { width: 34px; height: 34px; border-radius: 10px; }
.btn-block { width: 100%; }
.files-toolbar .btn.active { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------ Formulaires */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 13px; font-weight: 640; color: var(--text-soft); margin-bottom: 6px; letter-spacing: .01em; }
.field:focus-within > .label { color: var(--text); }
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 5px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 16px; align-items: end; }
.form-grid .field { margin-bottom: 0; }
.form-grid-switches { margin-top: 14px; }
.input, .select, textarea.input {
  width: 100%; padding: 9.5px 13px; min-height: 43px; font: inherit; font-size: var(--fs-md); color: var(--text);
  background: var(--field-bg); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--accent); background: var(--bg-elevated); box-shadow: var(--ring); }
.input::placeholder { color: var(--text-faint); }
.input:disabled, .select:disabled, .input[readonly] { opacity: .62; cursor: not-allowed; background: var(--bg-sunken); }
.input:invalid:not(:placeholder-shown) { border-color: var(--danger); }
.input[type="password"] { letter-spacing: .06em; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d99a9' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.select option { background: var(--bg-elevated); color: var(--text); }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); cursor: pointer; }
.checkbox-row .lbl { font-size: 14px; } .checkbox-row .sub { display: block; font-size: 12.5px; color: var(--text-faint); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 6px; display: none; }
.form-error.show { display: block; }
.form-ok { color: var(--success); font-size: 13px; margin-top: 6px; display: none; }
.form-ok.show { display: block; background: var(--success-soft); }
.auth-card .form-error.show, .auth-card .form-ok.show {
  padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent); font-weight: 560;
}
.input-group { display: flex; gap: 8px; } .input-group > * { flex: 1; }
label.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-soft); cursor: pointer; padding: 4px 2px; border-radius: 7px; }
label.chk input { accent-color: var(--accent); } label.chk:hover { color: var(--text); }
.otp-input { text-align: center; font-size: 22px; letter-spacing: .45em; font-family: var(--font-mono); }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 26px; transition: background var(--transition), box-shadow var(--transition); cursor: pointer; }
.switch .track::before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform var(--dur-3) var(--ease-spring); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.switch input:checked + .track { background: var(--grad); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ Cartes (verre) */
.card {
  position: relative; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--glass-hi);
  backdrop-filter: blur(var(--blur)) saturate(1.6); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.6);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.card-pad { padding: var(--sp-6); }
.card-hover:hover { box-shadow: var(--shadow), var(--glass-hi); border-color: color-mix(in srgb, var(--accent) 30%, var(--glass-border)); transform: translateY(-3px); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: var(--sp-5) var(--sp-6) 0; flex-wrap: wrap; }
.card-head h3, .card-head .section-title { margin: 0; }
.card-head a.text-faint { font-size: var(--fs-xs); font-weight: 600; transition: color var(--transition-fast); }
.card-head a.text-faint:hover { color: var(--accent-text); text-decoration: none; }
.card > .card-pad { padding: var(--sp-4) var(--sp-5) var(--sp-5); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  line-height: 1.45; background: var(--bg-sunken); color: var(--text-soft); border: 1px solid var(--border); white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge .icon { width: 13px; height: 13px; flex: none; }
/* v3.1.1 — marque distinctive « partagé avec moi » */
.badge-shared {
  background: var(--share-soft); color: var(--share-text);
  border-color: color-mix(in srgb, var(--share) 34%, transparent);
  font-weight: 640; gap: 4px;
}
.badge-shared .icon { width: 12px; height: 12px; }
tr.is-shared .fname-text { color: var(--share-text); }
tr.is-shared td.cell-name, tr.is-shared td:nth-child(2) { box-shadow: inset 3px 0 0 var(--share); }
.file-card.is-shared { border-color: color-mix(in srgb, var(--share) 40%, var(--glass-border)); }
.file-card.is-shared .name { color: var(--share-text); }
/* v3.3.0 — pastille « partagé avec moi » sur la VIGNETTE (miniatures/mosaïque) :
   le marqueur doit rester perceptible dans toutes les vues, pas seulement en détail. */
.file-card .shared-badge {
  position: absolute; top: 9px; left: 34px; z-index: 3; width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  background: var(--glass-strong); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--share) 45%, transparent);
  color: var(--share); box-shadow: var(--shadow-sm); pointer-events: none;
}
.file-card .shared-badge .icon { width: 13px; height: 13px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); display: inline-block; flex: none; }
.dot.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } .dot.off { background: var(--danger); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: var(--grad); color: var(--accent-contrast); border: 2px solid var(--glass-strong);
  font-size: 13px; font-weight: 720; flex: none; user-select: none; cursor: pointer; padding: 0;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 28%, transparent); transition: box-shadow var(--transition), transform var(--transition);
}
.avatar:hover { box-shadow: var(--ring), 0 4px 14px color-mix(in srgb, var(--accent) 36%, transparent); transform: scale(1.05); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 76px; height: 76px; font-size: 26px; } .avatar-sm { width: 28px; height: 28px; font-size: 11px; border-width: 1.5px; }
.avatar-xl { width: 84px; height: 84px; font-size: 28px; }

/* ------------------------------------------------------------ Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--glass); box-shadow: var(--shadow-sm), var(--glass-hi); backdrop-filter: blur(var(--blur)) saturate(1.5); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  padding: 13px var(--sp-4); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-sunken) 55%, transparent); white-space: nowrap;
}
.table td { padding: 13px var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:focus-within { background: var(--accent-softer); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.sortable { cursor: pointer; user-select: none; transition: color var(--transition-fast); }
.table th.sortable:hover { color: var(--accent-text); }

.progress { height: 8px; background: var(--bg-sunken); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.progress > .bar { height: 100%; width: 0%; border-radius: 999px; background: var(--grad); transition: width 900ms var(--ease-out); position: relative; overflow: hidden; }
.progress > .bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .4) 50%, transparent 70%); animation: nvShine 3.2s ease-in-out infinite; }
.progress > .bar.danger { background: linear-gradient(90deg, var(--danger), #fb7185); }
.progress > .bar.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-lg { height: 12px; } .progress-sm { height: 4px; }
@keyframes nvShine { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* ------------------------------------------------------------ États */
.empty-state { text-align: center; padding: 72px 24px; color: var(--text-faint); }
.empty-state > .icon { width: 56px; height: 56px; margin: 0 auto 16px; display: block; color: var(--accent); opacity: .55; animation: nvFloat 5s ease-in-out infinite; }
.empty-state .icon-tile { margin: 0 auto 14px; } .empty-state .icon-tile .icon, .empty-state .btn .icon { width: 18px; height: 18px; margin: 0; opacity: 1; animation: none; }
.empty-state .title { font-weight: 680; color: var(--text-soft); margin-bottom: 6px; font-size: var(--fs-lg); }
.empty-state p { max-width: 46ch; margin-inline: auto; }
@keyframes nvFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.skeleton { background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-hover) 50%, var(--bg-sunken) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 700ms linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-loader { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--text-faint); }
.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%) scale(.9);
  background: var(--text); color: var(--bg-elevated); font-size: 12px; font-weight: 540; padding: 5px 9px; border-radius: 8px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 140ms, transform 140ms; z-index: 95;
}
.tooltip:hover::after, .tooltip:focus-visible::after { opacity: 1; transform: translateX(-50%) scale(1); }
/* v3.1.0 — infobulle large (descriptions de sécurité sur les champs) : texte
   multi-ligne borné en largeur, au lieu d'une seule ligne qui déborde l'écran. */
.tooltip.tooltip-wide::after { white-space: normal; width: max-content; max-width: min(280px, 78vw); text-align: left; line-height: 1.45; }
/* Icône d'information (i) dans la ligne de libellé d'un champ. */
.label-row { display: flex; align-items: center; gap: 6px; }
.label-row > .label { margin-bottom: 0; flex: none; }
.label-info-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px;
  border: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--text-faint); cursor: help;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.label-info-btn:hover, .label-info-btn:focus-visible { color: var(--accent-text); background: var(--accent-soft); outline: none; }

.tabs { display: flex; gap: 4px; margin-bottom: var(--sp-6); overflow-x: auto; scrollbar-width: none; padding: 5px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-md); width: fit-content; max-width: 100%; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 16px; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); border-radius: var(--r-xs); white-space: nowrap; transition: color var(--transition), background var(--transition); }
.tab:hover { color: var(--text); background: var(--bg-hover); }
.tab.active { color: var(--accent-contrast); background: var(--grad); font-weight: 680; box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 32%, transparent); }

/* ------------------------------------------------------------ Menus, modales, toasts */
.dropdown { position: relative; display: inline-block; }
.dropdown .dd-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 224px; z-index: 65; padding: 6px; display: none;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow-lg), var(--glass-hi);
  backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7); animation: popIn 160ms var(--ease-spring); transform-origin: top right;
}
.dropdown.open .dd-menu { display: block; }
.dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 9px; border: 0;
  background: transparent; font: inherit; font-size: 13.5px; font-weight: 560; color: var(--text); cursor: pointer; min-height: 37px;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.dd-item:hover { background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.dd-item.danger { color: var(--danger); } .dd-item.danger:hover { background: var(--danger-soft); color: var(--danger); }
.dd-item .icon { width: 16px; height: 16px; flex: none; opacity: .85; }
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-head { padding: 8px 11px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-menu--floating {
  position: fixed; display: block; z-index: 210; min-width: 224px; padding: 6px; max-height: min(65vh, 420px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow-lg), var(--glass-hi);
  backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7); animation: ddFloatIn 140ms var(--ease-spring); transform-origin: top right;
}
.dd-menu--floating.menu-above { transform-origin: bottom right; }
.dd-menu--floating .dd-item { padding-inline: 11px 26px; }
@keyframes ddFloatIn { from { opacity: 0; transform: scale(.95) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { transform: scale(.95) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fadeIn 160ms ease; overflow-y: auto; backdrop-filter: blur(8px) saturate(1.3); -webkit-backdrop-filter: blur(8px) saturate(1.3); }
.modal {
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg), var(--glass-hi);
  width: 100%; max-width: 520px; max-height: calc(100dvh - 36px); display: flex; flex-direction: column; animation: popIn 260ms var(--ease-spring);
  backdrop-filter: blur(28px) saturate(1.7); -webkit-backdrop-filter: blur(28px) saturate(1.7);
}
.modal.modal-lg { max-width: 760px; }
/* v3.1.0 — repli `vh` AVANT `dvh` (navigateurs sans support dvh : sinon la
   fenêtre du visualiseur déborde de l'écran) + max-height de sécurité. */
.modal.modal-xl { max-width: 1080px; height: calc(100vh - 36px); height: calc(100dvh - 36px); max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); }
.modal .m-head { display: flex; align-items: center; gap: 10px; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); flex: none; }
.modal .m-head h3 { margin: 0; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal .m-body { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 9px; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); flex: none; flex-wrap: wrap; }
@media (max-width: 560px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-height: 96dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: sheetUp 300ms var(--ease-out); }
  .modal .m-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); } .modal .m-foot .btn { flex: 1; }
}
@keyframes sheetUp { from { transform: translateY(44px); opacity: .4; } to { transform: none; opacity: 1; } }

.toast-stack { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(390px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px; font-size: 13.5px; font-weight: 520;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-left: 3px solid var(--accent); border-radius: var(--radius);
  box-shadow: var(--shadow-lg), var(--glass-hi); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); animation: nvToastIn 300ms var(--ease-spring);
}
@keyframes nvToastIn { from { opacity: 0; transform: translateX(28px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateX(28px); transition: all 220ms; }
.toast .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.success { border-left-color: var(--accent); } .toast.success .icon { color: var(--accent); }
.toast.error { border-left-color: var(--danger); } .toast.error .icon { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); } .toast.warning .icon { color: var(--warning); }
.toast.info { border-left-color: var(--info); } .toast.info .icon { color: var(--info); }
@media (max-width: 640px) { .toast-stack { left: 12px; right: 12px; top: 12px; max-width: none; } }

/* ================================================================
   Shell applicatif : barre latérale (type Google Drive) + barre du haut
   ================================================================ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--sidebar-bg); border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7);
/* v3.3.0 — la lueur colorée qui débordait de la barre latérale est supprimée ;
   l'interface gagne en place un fond en dégradés doux, dérivés du thème
   (voir « Fond aurore » ci-dessous et le dégradé fixe de <html>). */
  box-shadow: 1px 0 0 var(--border);
  transition: margin-left var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px; padding: 18px 20px 10px; flex: none;
  font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); text-decoration: none;
}
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand img { width: 32px; height: 32px; border-radius: 10px; transition: transform var(--dur-3) var(--ease-spring); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.sidebar .brand:hover img { transform: scale(1.08) rotate(-5deg); }

/* Bouton « Nouveau » (style Drive) */
.sb-new { padding: 8px 16px 6px; flex: none; }
.sb-new .dropdown { display: block; }
.btn-new {
  display: inline-flex; align-items: center; gap: 12px; width: 100%; padding: 0 22px 0 16px; min-height: 52px;
  border: 0; border-radius: 18px; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px; color: var(--accent-contrast);
  background: var(--grad); background-size: 150% 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), var(--glow);
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition), background-position var(--dur-3) var(--ease);
}
.btn-new:hover { transform: translateY(-2px) scale(1.01); background-position: 100% 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 12px 34px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn-new:active { transform: scale(.97); }
.btn-new:focus-visible { outline: none; box-shadow: var(--ring), var(--glow); }
.btn-new .plus { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .22); transition: transform var(--dur-3) var(--ease-spring); }
.btn-new .plus .icon { width: 16px; height: 16px; }
.btn-new[aria-expanded="true"] .plus { transform: rotate(135deg); }

.sb-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 10px; scrollbar-gutter: stable; }
.nav-group { padding: 2px 12px 8px; }
.nav-group .group-label { font-size: 10.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: 14px 12px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 0; border-radius: 12px;
  color: var(--text-soft); font-weight: 560; font-size: 14px; transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-item:active { transform: scale(.985); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 680; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.nav-item.has-active { color: var(--text); font-weight: 640; }
.nav-item .icon { width: 19px; height: 19px; flex: none; transition: transform var(--dur-2) var(--ease-spring); }
.nav-item:hover .icon { transform: scale(1.12); }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 720; background: var(--bg-active); color: var(--text-soft); border-radius: 999px; padding: 1px 8px; }
.nav-item.active .count { background: var(--accent-strong); color: var(--accent-contrast); }

/* Ligne parente dépliable (Mes fichiers / Organisations) */
.nav-row { position: relative; }
.nav-row .nav-item { padding-right: 38px; }
.nav-caret {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-caret:hover { background: var(--bg-active); color: var(--text); }
.nav-caret .icon { width: 14px; height: 14px; transition: transform var(--dur-3) var(--ease-out); }
.nav-parent.open > .nav-row .nav-caret .icon { transform: rotate(90deg); }
.nav-row .nav-item .count { margin-right: 2px; }

/* Arborescence — repli animé sans re-rendu */
.tree-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-3) var(--ease-out); }
.tree-collapse > * { overflow: hidden; min-height: 0; }
.nav-parent.open > .tree-collapse, .tree-node-item.open > .tree-collapse { grid-template-rows: 1fr; }
.nav-tree-scroll { padding: 2px 0 4px; }
.tree-node, .tree-children { list-style: none; margin: 0; padding: 0; }
.tree-node-item { list-style: none; margin: 0; padding: 0; }
.tree-row {
  --depth: 1; display: flex; align-items: center; gap: 2px; position: relative; min-height: 34px; margin: 1px 0;
  padding: 2px 8px 2px calc(8px + var(--depth) * 14px); border-radius: 10px; color: var(--text-soft); font-size: 13.5px; font-weight: 540;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.tree-row:hover { background: var(--bg-hover); color: var(--text); }
.tree-row.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 680; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent); }
.tree-row.active::before { content: ""; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.tree-row.drop-target { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.tree-caret {
  width: 20px; height: 20px; flex: none; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-faint); border-radius: 6px; padding: 0; transition: background var(--transition-fast), color var(--transition-fast);
}
.tree-caret:hover { color: var(--text); background: var(--bg-active); }
.tree-caret .icon { width: 12px; height: 12px; transition: transform var(--dur-3) var(--ease-out); }
.tree-caret.hidden { visibility: hidden; }
.tree-node-item.open > .tree-row > .tree-caret .icon, .tree-caret.expanded .icon { transform: rotate(90deg); }
.tree-link { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: inherit; text-decoration: none; padding: 5px 0; }
.tree-link:hover { text-decoration: none; }
.tree-link .icon { width: 17px; height: 17px; flex: none; color: var(--accent); fill: color-mix(in srgb, var(--accent) 18%, transparent); transition: transform var(--dur-2) var(--ease-spring); }
.tree-row:hover .tree-link .icon { transform: scale(1.1); }
.tree-node-item.open > .tree-row > .tree-link .icon, .tree-row.active .tree-link .icon { fill: color-mix(in srgb, var(--accent) 32%, transparent); }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-count { font-size: 10.5px; font-weight: 650; color: var(--text-faint); background: var(--bg-sunken); border-radius: 999px; padding: 0 7px; line-height: 17px; flex: none; }
.tree-row.active .tree-count { background: var(--accent-soft); color: var(--accent-text); }
.tree-org-item > .tree-row .tree-link .icon { fill: color-mix(in srgb, var(--p2) 22%, transparent); color: var(--accent-2); }
.tree-org-head { display: flex; align-items: center; gap: 4px; }
.tree-org-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-loading, .tree-empty { font-size: 12.5px; color: var(--text-faint); padding: 8px 14px 8px 36px; line-height: 1.5; }
.tree-skeleton { height: 26px; margin: 5px 10px 5px 34px; border-radius: 8px; }
.tree-empty a { font-weight: 640; }

/* Stockage + utilisateur */
.sidebar-storage {
  flex: none; margin: 4px 14px 10px; padding: 14px 15px; border-radius: var(--r-md);
  background: var(--grad-soft); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--glass-border));
}
.sidebar-storage .progress { height: 7px; background: color-mix(in srgb, var(--bg-sunken) 80%, transparent); }
.sidebar-user { flex: none; padding: 10px 14px 14px; border-top: 1px solid var(--border); }
.sidebar-user-link { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 12px; transition: background var(--transition-fast); }
.sidebar-user-link:hover { background: var(--bg-hover); text-decoration: none; }
.sidebar-user-link .avatar { cursor: pointer; }
.sidebar-user-name { display: block; font-size: 13.5px; font-weight: 680; color: var(--text); line-height: 1.3; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-mail { display: block; font-size: 11.8px; color: var(--text-faint); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .chev { margin-left: auto; width: 15px; height: 15px; color: var(--text-faint); flex: none; }
.sidebar-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 39; opacity: 0; pointer-events: none; transition: opacity 240ms; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 8px; padding: 0 24px;
  background: var(--topbar-bg); border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(1.8); -webkit-backdrop-filter: blur(22px) saturate(1.8);
}
.topbar .search-box { flex: 1 1 140px; min-width: 0; max-width: 600px; position: relative; }
.topbar .search-box .input {
  padding-left: 42px; padding-right: 44px; min-height: 44px; border-radius: 999px; background: color-mix(in srgb, var(--bg-sunken) 78%, transparent); border-color: transparent; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .05);
}
.topbar .search-box .input:hover { border-color: var(--border-strong); }
.topbar .search-box .input:focus { background: var(--bg-elevated); border-color: var(--accent); }
.topbar .search-box .icon-search { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-faint); pointer-events: none; }
.search-kbd {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; font: 600 11.5px var(--font-mono);
  color: var(--text-faint); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; line-height: 18px;
}
.search-box .input:focus ~ .search-kbd { opacity: 0; }
.topbar .spacer { flex: 1; }
.topbar .badge-dot {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--danger-strong); color: #fff; border-radius: 999px;
  font-size: 10.5px; font-weight: 720; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); animation: nvPing 2.4s ease-in-out infinite;
}
@keyframes nvPing { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); } 50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); } }
.topbar-upload { display: none; }

.page { padding: 30px 30px 40px; max-width: 1320px; width: 100%; margin: 0 auto; flex: 1; }
.page-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: var(--sp-6); }
.page-header h1 { margin: 0; font-size: clamp(22px, 2.4vw, 29px); letter-spacing: -.03em; line-height: 1.2; }
.page-header .page-sub { margin: 5px 0 0; color: var(--text-soft); font-size: 14px; max-width: 62ch; }
.page-header .actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; align-self: center; }

@media (min-width: 901px) { body.sidebar-collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w)); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; transform: translateX(-105%); box-shadow: var(--shadow-lg); background: var(--glass-strong); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }
  .page { padding: 18px 14px 28px; }
  .page-header .actions { margin-left: 0; width: 100%; } .page-header .actions .btn { flex: 1 1 auto; }
  .btn { min-height: 44px; } .btn-sm { min-height: 38px; }
  .topbar { gap: 4px; padding: 0 12px; } .topbar .icon-btn { width: 42px; height: 42px; }
  .topbar-upload { display: inline-flex; }
}
@media (max-width: 640px) { .topbar .spacer { display: none; } .search-kbd { display: none; } }
@media (max-width: 480px) { .topbar .search-box .input { padding-right: 14px; } }

/* ---- Sélecteur de thème (palette + mode) ---------------------------- */
.theme-menu { width: 288px; padding: 14px; }
.theme-menu .tm-title { font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin: 0 2px 10px; }
.theme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.theme-swatch {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: linear-gradient(135deg, var(--sw1), var(--sw2)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), 0 2px 8px color-mix(in srgb, var(--sw1) 40%, transparent);
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition);
}
.theme-swatch:hover { transform: scale(1.14); }
.theme-swatch.active { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--sw1), 0 4px 14px color-mix(in srgb, var(--sw1) 50%, transparent); }
.theme-swatch.active::after { content: ""; position: absolute; inset: 0; margin: auto; width: 11px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-1px) rotate(-45deg); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.mode-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; background: var(--bg-sunken); border-radius: 12px; }
.mode-seg button { border: 0; background: transparent; padding: 7px 4px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 620; color: var(--text-soft); display: flex; align-items: center; justify-content: center; gap: 6px; transition: background var(--transition-fast), color var(--transition-fast); }
.mode-seg button .icon { width: 14px; height: 14px; }
.mode-seg button:hover { color: var(--text); }
.mode-seg button.active { background: var(--bg-elevated); color: var(--accent-text); box-shadow: var(--shadow-sm); }
.theme-btn-dot { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, var(--p), var(--p2)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45), 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent); }

/* Sélecteur de palette (Paramètres → Profil) */
.palette-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px; max-width: 560px; }
.palette-dot {
  position: relative; height: 62px; border-radius: var(--r-md); cursor: pointer; border: 2px solid transparent; padding: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--sw1, var(--p)), var(--sw2, var(--p2)));
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 255, 255, .25); transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition), border-color var(--transition);
}
.palette-dot span { position: absolute; left: 8px; bottom: 6px; font-size: 11.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.palette-dot:hover { transform: translateY(-3px) scale(1.03); box-shadow: var(--shadow); }
.palette-dot.active { border-color: var(--bg-elevated); box-shadow: 0 0 0 3px var(--sw1, var(--accent)), var(--shadow); }
.palette-dot.active::after { content: ""; position: absolute; right: 9px; top: 9px; width: 16px; height: 16px; border-radius: 50%; background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/10px no-repeat; }

.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-faint); margin-bottom: 16px; padding: 6px 8px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px; width: fit-content; max-width: 100%; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); }
.breadcrumb a { color: var(--text-soft); padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-weight: 580; transition: background var(--transition-fast), color var(--transition-fast); }
.breadcrumb a:hover { background: var(--accent-soft); text-decoration: none; color: var(--accent-text); }
.breadcrumb .sep { color: var(--text-faint); opacity: .5; }
.breadcrumb .current { color: var(--text); font-weight: 700; padding: 4px 8px; }

/* ================================================================
   Gestionnaire de fichiers
   ================================================================ */
.files-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.files-toolbar .spacer { flex: 1; }
.files-toolbar .select { width: auto; min-height: 40px; padding-top: 6px; padding-bottom: 6px; border-radius: 999px; padding-left: 16px; }
.files-toolbar .input { width: auto; min-width: 170px; max-width: 280px; border-radius: 999px; }
.view-toggle { display: inline-flex; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px; padding: 3px; gap: 2px; }
.view-toggle button { border: 0; background: transparent; padding: 6px 10px; cursor: pointer; color: var(--text-faint); display: inline-flex; align-items: center; border-radius: 9px; min-height: 32px; transition: background var(--transition-fast), color var(--transition-fast); }
.view-toggle button:hover { color: var(--text); }
.view-toggle button.active { background: var(--bg-elevated); color: var(--accent-text); box-shadow: var(--shadow-sm); }

.fname { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; font-weight: 580; font-size: var(--fs-sm); }
.fname:hover { color: var(--accent-text); text-decoration: none; }
.fname-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname-badges { display: inline-flex; gap: 4px; flex: none; } .fname-badges .badge { padding: 1px 8px; font-size: 11px; }
.ft-thumb { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg-sunken); box-shadow: 0 0 0 1px var(--border), var(--shadow-sm); }
.ft-icon { display: inline-flex; flex: none; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; background: var(--grad-soft); }
.ft-icon svg { width: 19px; height: 19px; }
.files-table th:first-child, .files-table td:first-child { width: 42px; padding-right: 0; }
.files-table td { padding: 10px var(--sp-4); }
.files-table .cell-actions { text-align: right; white-space: nowrap; }
.row-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.file-name-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.file-name-cell .meta { min-width: 0; }
.file-name-cell .name { font-weight: 590; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; }
.file-name-cell .name:hover { color: var(--accent-text); }
.file-name-cell .sub { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity var(--transition-fast); }
tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }
.icon-mini-btn { width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background var(--transition-fast), color var(--transition-fast); }
.icon-mini-btn:hover { background: var(--bg-active); color: var(--text); } .icon-mini-btn .icon { width: 16px; height: 16px; }
.row-selected, .files-table tr.row-selected { background: var(--accent-soft) !important; }
.fav-star { color: #f59e0b; }
.cell-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.icon-share-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; padding: 0; transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast); }
.icon-share-btn:hover { background: var(--accent-soft); color: var(--accent); transform: scale(1.08); } .icon-share-btn .icon { width: 16px; height: 16px; }

/* Grille de cartes */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: var(--sp-4); }
.file-card { cursor: pointer; position: relative; border-radius: var(--radius-lg); overflow: visible; }
.file-card .thumb {
  height: 132px; display: flex; align-items: center; justify-content: center; color: var(--accent); overflow: hidden; position: relative;
  background: var(--grad-soft); border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; text-decoration: none;
}
.file-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.file-card:hover .thumb img { transform: scale(1.07); }
.file-card .thumb .icon, .file-card .thumb svg { width: 46px; height: 46px; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--accent) 35%, transparent)); transition: transform var(--dur-3) var(--ease-spring); }
.file-card:hover .thumb svg { transform: scale(1.12) rotate(-3deg); }
.file-card .card-body { padding: 12px 14px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); }
.file-card .card-body .name { font-size: 13.5px; font-weight: 620; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.file-card .card-body .name:hover { color: var(--accent-text); text-decoration: none; }
.file-card .card-body .size { font-size: 12px; color: var(--text-faint); flex: none; }
.file-card .fav-badge { position: absolute; top: 9px; right: 48px; background: var(--glass-strong); border-radius: 999px; padding: 4px 6px; box-shadow: var(--shadow-sm); color: #f59e0b; font-size: 12px; line-height: 1; z-index: 3; }
.file-card .check { position: absolute; top: 10px; left: 10px; z-index: 3; width: 18px; height: 18px; accent-color: var(--accent); opacity: 0; transition: opacity var(--transition-fast); }
.file-card:hover .check, .file-card.selected .check, .file-card:focus-within .check { opacity: 1; }
@media (hover: none) { .file-card .check { opacity: 1; } }
.file-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.file-card .card-actions { position: absolute; top: 8px; right: 8px; display: inline-flex; gap: 4px; z-index: 3; opacity: 0; transition: opacity var(--transition-fast); }
.file-card:hover .card-actions, .file-card:focus-within .card-actions, .file-card .card-actions:has(.open) { opacity: 1; }
@media (hover: none) { .file-card .card-actions { opacity: 1; } }
.file-card .card-actions .btn, .file-card .card-actions .icon-share-btn { background: var(--glass-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-sm); width: 32px; height: 32px; border-radius: 10px; min-height: 0; }
.files-grid.mosaic { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.files-grid.mosaic .file-card .thumb { height: 180px; }
.files-grid.mosaic .file-card .thumb svg { width: 60px; height: 60px; }
.files-grid.mosaic .file-card .card-body { padding: 14px 16px; }
.files-grid.mosaic .file-card .card-body .name { font-size: 14px; font-weight: 650; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.files-grid.mosaic .file-card .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, .22)); opacity: 0; transition: opacity var(--transition); pointer-events: none; }
.files-grid.mosaic .file-card:hover .thumb::after { opacity: 1; }

/* Dossiers (arbre déplacer/copier) */
.folder-tree { border: 1px solid var(--border); border-radius: var(--radius); max-height: 300px; overflow-y: auto; background: var(--bg-elevated); }
.folder-tree .ft-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 10px 14px; border: 0; background: transparent; cursor: pointer; text-align: left; font: inherit; color: var(--text); border-bottom: 1px solid var(--border); transition: background var(--transition-fast); }
.folder-tree .ft-item:last-child { border-bottom: 0; }
.folder-tree .ft-item:hover { background: var(--bg-hover); }
.folder-tree .ft-item.active { background: var(--accent-soft); color: var(--accent-text); }
.folder-tree .ft-item .ft-name { font-weight: 600; font-size: 13.5px; } .folder-tree .ft-item .ft-path { font-size: 11.5px; color: var(--text-faint); }
.tree-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; border-radius: 10px; margin: 2px 6px; font-size: 13.8px; transition: background var(--transition-fast); }
.tree-item:hover { background: var(--bg-hover); }
.tree-item.selected { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.tree-item .icon { width: 16px; height: 16px; color: var(--accent); }
.tree-item .t-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Barre d'actions groupées (verre flottant) */
.bulk-bar {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, calc(100% + 40px)); display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 20px; box-shadow: var(--shadow-lg), var(--glass-hi); z-index: 35;
  backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8); max-width: calc(100vw - 32px);
  transition: transform var(--dur-3) var(--ease-spring), opacity var(--dur-2) var(--ease), visibility var(--dur-2); opacity: 0; visibility: hidden; pointer-events: none;
}
.bulk-bar.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; }
.bulk-bar .btn { white-space: nowrap; } .bulk-bar .count { font-weight: 700; padding: 0 10px; white-space: nowrap; color: var(--accent-text); }
@media (max-width: 640px) { .bulk-bar { bottom: max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; justify-content: center; } }

/* Dépôt + téléversement */
.dropzone-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; opacity: 0; transition: opacity 180ms; }
.dropzone-overlay.show { opacity: 1; }
.dropzone-overlay .dz-box { border: 2.5px dashed var(--accent); border-radius: var(--radius-xl); background: var(--glass-strong); color: var(--accent-text); font-weight: 700; font-size: 18px; padding: 48px 68px; display: flex; flex-direction: column; align-items: center; gap: 14px; box-shadow: var(--shadow-lg), var(--glow); margin: 20px; animation: nvFloat 3s ease-in-out infinite; }
.dropzone-overlay .icon { width: 46px; height: 46px; }
.upload-panel { position: fixed; right: 22px; bottom: 22px; width: 380px; max-width: calc(100vw - 32px); background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg), var(--glass-hi); z-index: 60; overflow: hidden; backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7); transform-origin: bottom right; animation: slideUp 320ms var(--ease-spring); }
@keyframes slideUp { from { transform: translateY(24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.upload-panel.closing { opacity: 0; transform: translateY(14px) scale(.97); transition: opacity 220ms ease, transform 220ms ease; pointer-events: none; }
.upload-panel .up-head { display: flex; align-items: center; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; } .upload-panel .up-head .spacer { flex: 1; }
.upload-panel .up-list { max-height: 320px; overflow-y: auto; }
.upload-item { padding: 12px 16px; border-bottom: 1px solid var(--border); } .upload-item:last-child { border-bottom: 0; }
.upload-item .u-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.upload-item .u-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .u-state { font-size: 12px; color: var(--text-faint); flex: none; } .upload-item .u-state.err { color: var(--danger); } .upload-item .u-state.ok { color: var(--accent-text); font-weight: 650; }
.upload-item .u-actions { display: flex; gap: 2px; margin-top: 4px; } .upload-item .u-speed { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }
@media (max-width: 640px) { .upload-panel { right: 10px; left: 10px; width: auto; bottom: max(10px, env(safe-area-inset-bottom)); } }

/* Prévisualisation */
.preview-layout { display: flex; min-height: 0; flex: 1; }
.preview-stage { flex: 1; min-width: 0; background: color-mix(in srgb, var(--bg-sunken) 85%, transparent); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.preview-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 200ms; border-radius: 6px; }
.preview-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-stage video, .preview-stage audio { max-width: 100%; outline: none; }
.preview-stage .pv-zoomable { cursor: zoom-in; }
.preview-stage .pv-text { width: 100%; height: 100%; overflow: auto; padding: 18px; }
.preview-stage .pv-text pre { margin: 0; font-family: var(--font-mono); font-size: 12.8px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.preview-stage .pv-text table { border-collapse: collapse; width: max-content; min-width: 100%; }
.preview-stage .pv-text td, .preview-stage .pv-text th { border: 1px solid var(--border); padding: 4px 10px; font-size: 12.8px; text-align: left; }
.preview-stage .pv-csv th { background: var(--bg-sunken); position: sticky; top: 0; }
.pv-toolbar { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 5; }
.pv-toolbar .icon-mini-btn { background: var(--glass-strong); box-shadow: var(--shadow-sm); border: 1px solid var(--glass-border); width: 36px; height: 36px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pv-aside-toggle { display: none; } @media (max-width: 720px) { .pv-aside-toggle { display: inline-flex; } }
.preview-aside { width: 340px; flex: none; border-left: 1px solid var(--border); display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg-elevated) 70%, transparent); }
.preview-aside .pa-tabs { display: flex; border-bottom: 1px solid var(--border); flex: none; }
.preview-aside .pa-tabs button { flex: 1; padding: 12px 6px; border: 0; background: transparent; font: inherit; font-size: 12.8px; font-weight: 640; color: var(--text-soft); cursor: pointer; border-bottom: 2px solid transparent; transition: color var(--transition-fast), border-color var(--transition-fast); }
.preview-aside .pa-tabs button.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.preview-aside .pa-body { flex: 1; overflow-y: auto; padding: 16px; }
.preview-aside .pa-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
@media (max-width: 720px) { .preview-aside { position: fixed; right: 0; top: 0; bottom: 0; z-index: 68; width: min(350px, 92vw); background: var(--glass-strong); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform 300ms var(--ease-out); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); } .preview-aside.open { transform: translateX(0); } }
/* v3.1.0 — BOUTON (i) OPÉRATIONNEL : sur desktop le volet latéral était déjà
   visible, le bouton (i) « ne faisait rien ». Le bouton masque/affiche désormais
   le volet sur desktop (.aside-hidden) et ouvre/ferme le tiroir sur mobile (.open,
   piloté par le même état). Sur mobile, aside-hidden est neutralisé. */
.preview-layout.aside-hidden .preview-aside { display: none; }
@media (max-width: 720px) { .preview-layout.aside-hidden .preview-aside { display: flex; position: fixed; right: 0; top: 0; bottom: 0; width: min(350px, 92vw); transform: translateX(105%); } .preview-layout.aside-hidden .preview-aside.open { transform: translateX(0); } }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13.2px; border-bottom: 1px dashed var(--border); } .detail-row:last-child { border-bottom: 0; }
.detail-row .k { color: var(--text-faint); flex: none; } .detail-row .v { text-align: right; word-break: break-all; min-width: 0; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); } .comment-item:last-child { border-bottom: 0; }
.comment-item .c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; } .comment-item .c-author { font-weight: 680; font-size: 13.2px; } .comment-item .c-date { font-size: 11.8px; color: var(--text-faint); margin-left: auto; }
.comment-item .c-body { font-size: 13.6px; white-space: pre-wrap; word-break: break-word; } .comment-item.resolved { opacity: .55; }
.share-person { display: flex; align-items: center; gap: 10px; padding: 9px 0; } .share-person .sp-name { font-weight: 600; font-size: 13.5px; } .share-person .sp-mail { font-size: 12px; color: var(--text-faint); }
.version-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; } .version-item:last-child { border-bottom: 0; }
.expiry-choices { display: flex; gap: 7px; flex-wrap: wrap; }
.expiry-choices .choice { padding: 8px 15px; border: 1px solid var(--border-strong); background: var(--field-bg); border-radius: 999px; font-size: 13px; cursor: pointer; font-weight: 580; transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast); }
.expiry-choices .choice:hover { border-color: var(--accent); transform: translateY(-1px); }
.expiry-choices .choice.active { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); font-weight: 700; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; }
.link-box .lk { flex: 1; font-family: var(--font-mono); font-size: 12.6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.8px; } .check-row:last-child { border-bottom: 0; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px var(--sp-4); border-bottom: 1px solid var(--border); transition: background var(--transition-fast); color: inherit; }
.list-row:hover { background: var(--bg-hover); text-decoration: none; } .list-row:last-child { border-bottom: 0; }
.notification-row { display: flex; gap: 12px; padding: 14px var(--sp-4); cursor: pointer; transition: background var(--transition-fast); border-radius: var(--r-sm); margin-bottom: 3px; }
.notification-row:hover { background: var(--bg-hover); } .notification-row.unread { background: var(--accent-softer); } .notification-row.unread:hover { background: var(--accent-soft); }
.notification-row .n-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.notification-row.read .n-dot { background: transparent; border: 1px solid var(--border-strong); box-shadow: none; }
.notification-list { display: flex; flex-direction: column; }

/* Mobile : le tableau de fichiers devient une liste de cartes */
@media (max-width: 720px) {
  .files-table thead { display: none; }
  .files-table, .files-table tbody, .files-table tr, .files-table td { display: block; width: 100%; }
  .files-table tr { position: relative; border-bottom: 1px solid var(--border); padding: 12px 14px 13px 44px; }
  .files-table tr:last-child { border-bottom: 0; }
  .files-table td { border: 0; padding: 0 !important; }
  .files-table td:first-child { position: absolute; left: 15px; top: 18px; width: auto; }
  .files-table td:nth-child(2) { padding-right: 78px !important; }
  .files-table .cell-size, .files-table .cell-date, .files-table .cell-who, .files-table .cell-owner { display: inline-block; width: auto; vertical-align: top; font-size: var(--fs-xs); color: var(--text-faint); margin: 4px 7px 0 0; max-width: 100%; }
  .files-table .cell-size::after { content: "·"; margin-left: 7px; opacity: .6; }
  .files-table .cell-role { display: inline-block; width: auto; margin-top: 4px; }
  .files-table .cell-actions { position: absolute; top: 9px; right: 9px; width: auto; }
  .files-table .fname { flex-wrap: wrap; } .files-table .fname-text { white-space: normal; overflow-wrap: anywhere; }
  .files-table .row-check { width: 18px; height: 18px; }
}

/* ================================================================
   Tableau de bord : hero, anneau de stockage, stats, graphiques
   ================================================================ */
.dash-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: var(--sp-6); align-items: center;
  padding: clamp(22px, 3.2vw, 38px); margin-bottom: var(--sp-6); border-radius: var(--r-xl);
  background:
    radial-gradient(60% 120% at 100% 0%, color-mix(in srgb, var(--p2) 26%, transparent), transparent 60%),
    radial-gradient(70% 110% at 0% 100%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 62%),
    var(--glass);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow), var(--glass-hi);
  backdrop-filter: blur(var(--blur)) saturate(1.6); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.6);
}
.dash-hero::before, .dash-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.dash-hero::before { width: 260px; height: 260px; right: -70px; top: -90px; background: var(--grad); opacity: .16; animation: nvOrb 14s ease-in-out infinite alternate; }
.dash-hero::after { width: 160px; height: 160px; left: 38%; bottom: -80px; background: var(--grad); opacity: .1; animation: nvOrb 18s ease-in-out infinite alternate-reverse; }
@keyframes nvOrb {
  /* v3.1.1 — PERFORMANCES : le `scale` forçait le redessin (rasterisation) du
     dégradé de l'orbe à CHAQUE image, et l'orbe se trouve sous une surface à
     backdrop-filter : le flou d'arrière-plan était donc recalculé en boucle.
     → translation seule : la couche est rasterisée une fois puis déplacée. */
  from { transform: translate(0, 0); }
  to   { transform: translate(-24px, 18px); }
}
.dash-hero-text { position: relative; z-index: 1; min-width: 0; }
.dash-hero h1 { font-size: clamp(24px, 3.2vw, 36px); letter-spacing: -.035em; margin-bottom: 8px; }
.dash-hero .page-sub { color: var(--text-soft); font-size: 15px; max-width: 52ch; margin: 0 0 20px; }
.dash-hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-hero-side { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 18px; min-width: 0; }
.ring-wrap { position: relative; width: 148px; height: 148px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: color-mix(in srgb, var(--text) 9%, transparent); stroke-width: 12; }
.ring-bar { fill: none; stroke: url(#nvRingGrad); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 0 999; transition: stroke-dasharray 1.4s var(--ease-out); filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 45%, transparent)); }
.ring-bar.warning { stroke: var(--warning); } .ring-bar.danger { stroke: var(--danger); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-label strong { font-size: 30px; font-weight: 780; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-label small { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; font-weight: 600; }
.ring-meta { min-width: 0; }
.ring-meta .rm-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.ring-meta .rm-val { font-size: 19px; font-weight: 740; letter-spacing: -.02em; margin: 3px 0 2px; }
.ring-meta .rm-sub { font-size: 12.5px; color: var(--text-soft); margin-bottom: 8px; }
@media (max-width: 860px) { .dash-hero { grid-template-columns: 1fr; } .dash-hero-side { justify-content: flex-start; } }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-4); }
.stat-card { padding: var(--sp-5); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 142px; }
.stat-card::after { content: ""; position: absolute; width: 130px; height: 130px; right: -40px; bottom: -50px; border-radius: 50%; background: var(--grad); opacity: .07; transition: transform var(--dur-3) var(--ease-out), opacity var(--transition); pointer-events: none; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow), var(--glass-hi); }
.stat-card:hover::after { transform: scale(1.6); opacity: .13; }
.stat-card .stat-label { font-size: var(--fs-2xs); font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .07em; }
.stat-card .stat-value { font-size: clamp(28px, 2.8vw, 34px); font-weight: 780; letter-spacing: -.035em; margin-top: 8px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-card .stat-sub { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 8px; position: relative; z-index: 1; }
.stat-card .stat-sub a { font-weight: 650; }
.stat-card .stat-icon { position: absolute; top: var(--sp-4); right: var(--sp-4); width: 42px; height: 42px; border-radius: 13px; background: var(--grad); color: var(--accent-contrast); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent); transition: transform var(--dur-3) var(--ease-spring); }
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-6deg); }
.stat-card .stat-icon .icon { width: 21px; height: 21px; }
.stat-card .stat-icon.info { background: linear-gradient(135deg, #7c5cf0, #b06ef5); color: #fff; box-shadow: 0 6px 16px rgba(124, 92, 240, .32); }
.stat-card .stat-icon.warning { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; box-shadow: 0 6px 16px rgba(245, 158, 11, .32); }
.stat-card .stat-icon.danger { background: linear-gradient(135deg, #ef4444, #f43f5e); color: #fff; }
.stat-card .stat-body { position: relative; z-index: 1; }
.stat-card .stat-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--text-soft); font-weight: 560; }
.stat-spark { display: block; width: 100%; height: 34px; margin-top: 10px; overflow: visible; }
.stat-spark path.s-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: nvDraw 1.4s var(--ease-out) .3s forwards; }
.stat-spark path.s-area { fill: url(#nvAreaGrad); opacity: 0; animation: nvFadeIn .8s ease .9s forwards; }
@keyframes nvDraw { to { stroke-dashoffset: 0; } }
@keyframes nvFadeIn { to { opacity: 1; } }

.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: var(--sp-3); }
.shortcut { display: flex; align-items: center; gap: var(--sp-3); padding: 14px 16px; border: 1px solid var(--glass-border); border-radius: var(--radius); background: var(--glass); color: var(--text); text-decoration: none; transition: border-color var(--transition), background var(--transition), transform var(--dur-2) var(--ease-spring), box-shadow var(--transition); }
.shortcut:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-softer); transform: translateY(-3px); box-shadow: var(--shadow-sm), 0 8px 22px color-mix(in srgb, var(--accent) 16%, transparent); }
.shortcut-icon { width: 38px; height: 38px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--accent); transition: transform var(--dur-2) var(--ease-spring); }
.shortcut:hover .shortcut-icon { transform: scale(1.12) rotate(-5deg); }
.shortcut-icon .icon { width: 18px; height: 18px; }
.shortcut-title { font-size: var(--fs-sm); font-weight: 640; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bande « Récents » avec vignettes */
.recent-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(186px, 1fr); gap: var(--sp-4); overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; scroll-padding-left: 2px; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
/* v3.1.1 — navigation de la bande « Reprendre » : boutons de slide + glisser
   à la souris. Le défilement « à la souris » (drag) n'existe pas nativement :
   c'est ici qu'il est ajouté ; sur tactile, le défilement natif au doigt
   reste actif (scroll-snap aligne les cartes). */
.rc-nav-group { display: inline-flex; gap: 6px; }
.rc-nav {
  width: 32px; height: 32px; flex: none; border-radius: 9px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--glass-border); background: var(--glass); color: var(--text-soft);
  cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast), border-color var(--transition-fast);
}
.rc-nav .icon { width: 16px; height: 16px; }
.rc-nav:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 34%, var(--glass-border)); }
.rc-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rc-nav:disabled { opacity: .35; cursor: default; }
/* Curseur « saisie » pendant le glissement de la bande. */
.recent-strip.rc-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.recent-strip.rc-dragging .rc-card { pointer-events: none; }
.rc-card { scroll-snap-align: start; cursor: pointer; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.rc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* v2.9.0 — aperçus « Reprendre où vous en étiez » refaits : ratio stable,
   vignette bien cadrée, icône de repli lisible (fichiers ET dossiers). */
.rc-thumb { aspect-ratio: 16 / 9; height: auto; min-height: 96px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-soft), transparent 75%), var(--bg-sunken); color: var(--accent); overflow: hidden; border-bottom: 1px solid var(--border); }
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 500ms var(--ease-out); }
.rc-card:hover .rc-thumb img { transform: scale(1.08); }
.rc-thumb .icon { width: 40px; height: 40px; opacity: .92; filter: drop-shadow(0 6px 12px color-mix(in srgb, var(--accent) 35%, transparent)); transition: transform var(--dur-3) var(--ease-spring); }
.rc-card:hover .rc-thumb .icon { transform: scale(1.1); }
.rc-info { padding: 10px 13px 12px; min-width: 0; }
.rc-name { font-size: 13.5px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-meta { font-size: 11.8px; color: var(--text-faint); margin-top: 2px; display: flex; align-items: center; gap: 5px; min-width: 0; }
/* v4.0.0 — menu « burger » par carte + glissement souris sans drag natif */
.recent-strip { user-select: none; -webkit-user-select: none; }
.rc-thumb { position: relative; }
.rc-thumb img { -webkit-user-drag: none; user-drag: none; }
.rc-dd { position: absolute; top: 7px; right: 7px; z-index: 3; }
/* v5.0.0 — burger plus discret sur les petites cartes : 26 px (au lieu de 30),
   icône 14 px, rayon 8 px. */
.rc-menu {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 8px; border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--glass) 82%, transparent);
  backdrop-filter: blur(8px) saturate(1.4); -webkit-backdrop-filter: blur(8px) saturate(1.4);
  color: var(--text-soft); cursor: pointer; padding: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--dur-2) var(--ease-out);
}
/* v5.0.0 — l'icône du burger doit passer APRÈS `.rc-thumb .icon` (40 px) :
   sans ce surclassement, le pictogramme mesurait 40 px et DÉBORDAIT du
   bouton — c'était le « burger trop grand » signalé. Même correction pour
   les icônes des items du menu tant que celui-ci est rendu dans la vignette. */
.rc-thumb .rc-menu svg { width: 14px; height: 14px; }
.rc-thumb .dd-item .icon { width: 16px; height: 16px; }
.rc-menu:hover { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 34%, var(--glass-border)); transform: scale(1.06); }
.rc-menu:active { transform: scale(.96); }
.rc-menu:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropdown.open .rc-menu { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 34%, var(--glass-border)); }
.rc-kind { color: var(--accent-text); font-weight: 640; flex: none; }

/* Graphiques */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: var(--sp-5); align-items: stretch; }
.chart-card { padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; }
.chart-card .chart-title { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 4px; letter-spacing: -.015em; }
.chart-card .chart-sub { font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: var(--sp-4); }
.chart-card .chart-body { flex: 1; min-height: 212px; display: flex; align-items: center; justify-content: center; position: relative; }
.chart-card .chart-body > * { width: 100%; }
.chart-card svg { display: block; width: 100%; height: auto; max-height: 250px; }
.chart-card .empty-state { margin: auto; padding: 30px 8px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: var(--sp-4); font-size: var(--fs-xs); color: var(--text-soft); }
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--bg-sunken); font-weight: 560; }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 3px; }
.nv-chart text { font-family: var(--font-sans); }
.nv-chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.nv-chart .gridline { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.nv-chart .tick-label { fill: var(--text-faint); font-size: 10.5px; }
.nv-chart .bar { fill: url(#nvBarGrad); transform-box: fill-box; transform-origin: bottom; animation: nvGrow 800ms var(--ease-out) backwards; transition: filter 140ms, opacity 140ms; }
.nv-chart .bar:hover { filter: brightness(1.15) drop-shadow(0 4px 8px color-mix(in srgb, var(--accent) 45%, transparent)); }
.nv-chart .bar.alt { opacity: .4; }
@keyframes nvGrow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.nv-chart .area { fill: url(#nvAreaGrad); animation: nvFadeIn 1s ease .5s backwards; }
.nv-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; animation: nvDraw2 1.6s var(--ease-out) backwards; filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--accent) 35%, transparent)); }
@keyframes nvDraw2 { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }
.nv-chart .dot-point { fill: var(--bg-elevated); stroke: var(--accent); stroke-width: 2; transition: r 140ms; animation: nvFadeIn .5s ease 1.2s backwards; }
.nv-chart .dot-point:hover { r: 5; }
.nv-chart .donut-seg { transition: opacity 140ms, stroke-width 200ms; animation: nvFadeIn .9s ease backwards; stroke-linecap: butt; }
.nv-chart .donut-seg:hover { opacity: .85; stroke-width: 30; }
.nv-chart .donut-center { fill: var(--text); font-weight: 780; letter-spacing: -.03em; }
.nv-chart .donut-sub { fill: var(--text-faint); font-size: 11px; }

/* ================================================================
   Pense-bêtes
   ================================================================ */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: var(--sp-4); align-items: stretch; }
/* v2.9.0 : widget du tableau de bord — cartes compactes bien ajustées (pas de débordement). */
.notes-grid.widget { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)) !important; gap: 12px; }
.notes-grid.widget .note-card { padding: 13px 14px; gap: 7px; min-height: 132px; border-radius: var(--radius); }
.notes-grid.widget .note-title { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notes-grid.widget .note-body { font-size: 12.3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notes-grid.widget .note-card { cursor: pointer; }
.note-card { padding: 16px 17px; border-radius: var(--radius-lg); border: 1px solid transparent; display: flex; flex-direction: column; gap: 9px; min-height: 156px; box-shadow: var(--shadow-sm); transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition); }
.note-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow); }
.note-card.done { box-shadow: none; background-image: linear-gradient(var(--bg-sunken), var(--bg-sunken)); }
.note-card.done .note-title { text-decoration: line-through; color: var(--text-soft); } .note-card.done .note-body { opacity: .85; } .note-card.done .note-foot { opacity: .75; }
.note-card.pinned { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow-sm); }
.note-title { font-weight: 690; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.note-body { font-size: 13px; white-space: pre-wrap; word-break: break-word; flex: 1; opacity: .92; }
.note-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .note-meta .badge { font-size: 11px; padding: 2px 8px; }
.note-foot { display: flex; align-items: center; gap: 6px; font-size: 11.6px; margin-top: auto; padding-top: 4px; } .note-foot-spacer { flex: 1; }
.note-done { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; opacity: .9; } .note-done input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.note-foot .btn-icon { opacity: .6; } .note-card:hover .note-foot .btn-icon, .note-card:focus-within .note-foot .btn-icon { opacity: 1; }
.note-color-yellow { background: #fdf3c2; border-color: #e8d477; color: #4a3b00; }
.note-color-green  { background: #d7f0dd; border-color: #a3d6b3; color: #14432a; }
.note-color-blue   { background: #d8ecfa; border-color: #a8cdea; color: #0b3a58; }
.note-color-pink   { background: #fbdfe8; border-color: #eeb2c8; color: #55182d; }
.note-color-orange { background: #ffe7cd; border-color: #eec49b; color: #5c2e00; }
.note-color-gray   { background: var(--bg-sunken); border-color: var(--border-strong); color: var(--text); }
html[data-theme="dark"] .note-color-yellow { background: #3a3316; border-color: #5c5224; color: #f3e6ac; }
html[data-theme="dark"] .note-color-green  { background: #16342a; border-color: #275545; color: #b9ecd0; }
html[data-theme="dark"] .note-color-blue   { background: #14283a; border-color: #274a66; color: #bcdcf5; }
html[data-theme="dark"] .note-color-pink   { background: #3a1a26; border-color: #663046; color: #f5c1d4; }
html[data-theme="dark"] .note-color-orange { background: #382513; border-color: #664524; color: #f7d5ad; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .note-color-yellow { background: #3a3316; border-color: #5c5224; color: #f3e6ac; }
  html[data-theme="auto"] .note-color-green  { background: #16342a; border-color: #275545; color: #b9ecd0; }
  html[data-theme="auto"] .note-color-blue   { background: #14283a; border-color: #274a66; color: #bcdcf5; }
  html[data-theme="auto"] .note-color-pink   { background: #3a1a26; border-color: #663046; color: #f5c1d4; }
  html[data-theme="auto"] .note-color-orange { background: #382513; border-color: #664524; color: #f7d5ad; }
}

/* ================================================================
   Organisations, paramètres
   ================================================================ */
.orgs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--sp-5); align-items: start; }
.org-card { display: flex; flex-direction: column; gap: var(--sp-4); overflow: hidden; }
.org-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.org-card-head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.org-card-icon { width: 44px; height: 44px; border-radius: 13px; }
.org-card-title { min-width: 0; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.org-card-name { font-weight: 700; font-size: var(--fs-lg); letter-spacing: -.015em; line-height: 1.3; overflow-wrap: anywhere; }
.org-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.org-card-meta { display: flex; gap: var(--sp-5); margin: 0; padding: var(--sp-3) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.org-card-meta > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.org-card-meta dt { font-size: var(--fs-2xs); color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.org-card-meta dd { margin: 0; font-size: var(--fs-sm); font-weight: 650; color: var(--text); }
.org-card-storage { display: flex; flex-direction: column; gap: 7px; }
.org-card-storage-head { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); color: var(--text-soft); } .org-card-storage-head span:last-child { font-variant-numeric: tabular-nums; font-weight: 650; }
.org-card-libs { display: flex; flex-direction: column; gap: 2px; }
.org-card-eyebrow { font-size: var(--fs-2xs); font-weight: 680; color: var(--text-faint); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.org-lib { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; transition: background var(--transition-fast); }
.org-lib:hover { background: var(--accent-soft); text-decoration: none; } .org-lib .icon { width: 16px; height: 16px; flex: none; color: var(--accent); }
.org-lib-name { font-weight: 600; font-size: var(--fs-sm); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-lib-meta { margin-left: auto; font-size: var(--fs-2xs); color: var(--text-faint); flex: none; font-variant-numeric: tabular-nums; } .org-lib-empty { font-size: var(--fs-xs); padding: 4px 0; }
.org-card-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.settings-profile { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.identity-card { display: flex; flex-direction: column; gap: var(--sp-4); position: sticky; top: calc(var(--topbar-h) + var(--sp-4)); }
.identity-top { display: flex; align-items: center; gap: var(--sp-4); } .identity-top .avatar-xl { width: 80px; height: 80px; font-size: 27px; border-radius: 24px; }
.identity-meta { min-width: 0; } .identity-name { margin: 0 0 2px; font-size: var(--fs-xl); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-mail { margin: 0 0 8px; font-size: var(--fs-xs); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; } .identity-card .hint { margin: 0; }
@media (max-width: 900px) { .settings-profile { grid-template-columns: 1fr; } .identity-card { position: static; } }

/* ================================================================
   Pages publiques : auth, landing, partage
   ================================================================ */
.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-card { width: 100%; max-width: 448px; margin: auto; padding: 28px 22px; position: relative; z-index: 1; }
.auth-card h1 { font-size: 23px; }
.auth-card .card { padding: 36px 34px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg), var(--glass-hi); background: var(--glass-strong); animation: nvCardIn 600ms var(--ease-out) both; }
.auth-card .card::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: var(--grad); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 26px; font-size: 20px; font-weight: 800; letter-spacing: -.025em; color: var(--text); animation: nvCardIn 500ms var(--ease-out) both; }
.auth-brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 38%, transparent); }
.auth-foot { text-align: center; color: var(--text-faint); font-size: 13px; padding: 18px; line-height: 1.7; }
@keyframes nvCardIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-page::before, .auth-page::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; background: var(--grad); }
.auth-page::before { width: 340px; height: 340px; left: -90px; top: 10%; opacity: .14; animation: nvOrb 16s ease-in-out infinite alternate; }
.auth-page::after { width: 260px; height: 260px; right: -60px; bottom: 6%; opacity: .12; animation: nvOrb 20s ease-in-out infinite alternate-reverse; }

.lang-switch { display: inline-flex; border: 1px solid var(--glass-border); border-radius: 999px; overflow: hidden; background: var(--glass); padding: 3px; gap: 2px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lang-switch a { padding: 5px 12px; font-size: 12.5px; font-weight: 680; color: var(--text-soft); text-decoration: none; line-height: 1.5; border-radius: 999px; transition: background var(--transition-fast), color var(--transition-fast); }
.lang-switch a:hover { text-decoration: none; color: var(--text); background: var(--bg-hover); } .lang-switch a.active { background: var(--grad); color: var(--accent-contrast); }

.landing { position: relative; }
.landing-nav { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 4vw, 40px); background: var(--topbar-bg); border-bottom: 1px solid var(--glass-border); backdrop-filter: blur(22px) saturate(1.8); -webkit-backdrop-filter: blur(22px) saturate(1.8); }
.landing-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.landing-nav .brand:hover { text-decoration: none; } .landing-nav .brand img { width: 30px; height: 30px; border-radius: 9px; }
/* v3.1.1 — FLUIDITÉ (page de présentation) : l'aurore animée passait sous
   des surfaces en verre (barre de navigation, badge, cartes, pied de page).
   CHAQUE image de l'aurore invalidait le flou d'arrière-plan : le flou était
   recalculé en continu sur toute la largeur de la fenêtre, et le logo flottant
   saccadait (37 img/s mesurées en throttling CPU ×4, 60 img/s sans flou).
   → sur la page d'accueil, le verre devient un fond translucide STATIQUE :
   rendu visuellement équivalent, animation désormais à 60 img/s.
   Le flou d'arrière-plan reste actif dans l'application (barre latérale,
   barre supérieure, modales) où le fond est statique. */
.landing-nav {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.landing-hero .hero-badge {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
.landing-footer {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
}
.landing .card {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
}

.landing-hero { text-align: center; padding: clamp(56px, 9vw, 104px) 22px clamp(36px, 5vw, 56px); position: relative; overflow: hidden; }
.landing-hero > img {
  width: 68px; height: 68px; border-radius: 20px;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 40%, transparent);
  /* v3.1.1 — FLUIDITÉ DU LOGO : l'élément est promu sur sa propre couche de
     composition (will-change + translateZ) pour que son flottement soit
     calculé par le COMPOSITEUR (thread dédié) et non par le thread
     principal, occupé par l'aurore et les flous d'arrière-plan. */
  animation: nvFloat 6s cubic-bezier(.45, 0, .55, 1) infinite;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.landing-hero .hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; margin-bottom: 22px; background: var(--glass); color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--glass-border)); font-size: 13px; font-weight: 680; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); }
.landing-hero .hero-badge .dot { background: var(--accent); animation: pulseDot 2.2s ease infinite; }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 7px transparent; } }
.landing-hero h1 { font-size: clamp(34px, 6vw, 64px); font-weight: 820; letter-spacing: -.045em; line-height: 1.05; max-width: 860px; margin: 0 auto; }
.landing-hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-hero .sub { font-size: clamp(15.5px, 2vw, 19px); color: var(--text-soft); max-width: 650px; margin: 20px auto 34px; line-height: 1.65; }
.landing-hero .hero-cta { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.landing-hero .hero-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; margin-top: 32px; font-size: 13px; color: var(--text-faint); }
.landing-hero .hero-meta span { display: inline-flex; align-items: center; gap: 6px; } .landing-hero .hero-meta .icon { width: 14px; height: 14px; color: var(--accent); }
.hero-mock { position: relative; max-width: 980px; margin: clamp(40px, 6vw, 70px) auto 0; padding: 0 8px; perspective: 1400px; }
.hero-mock .hm-window {
  border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--glass-border); background: var(--glass-strong);
  box-shadow: var(--shadow-lg), var(--glow); transform: rotateX(6deg); transform-origin: 50% 100%;
  /* v3.1.1 — le backdrop-filter (20 px) était combiné à une rotation 3D sur
     une zone de ~980 px : le flou était recalculé en permanence. La maquette
     étant décorative (aria-hidden) sur un fond déjà opaque à 84 %, le flou est
     supprimé : rendu identique, animation bien plus fluide. */
  animation: nvHeroIn 1s var(--ease-out) both;
}
@keyframes nvHeroIn { from { opacity: 0; transform: rotateX(18deg) translateY(40px); } to { opacity: 1; transform: rotateX(6deg); } }
.hero-mock svg { display: block; width: 100%; height: auto; }
.landing-section-head { text-align: center; max-width: 660px; margin: 0 auto; padding: 60px 22px 8px; }
.landing-section-head h2 { font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -.035em; } .landing-section-head p { color: var(--text-soft); margin-bottom: 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(284px, 1fr)); gap: 20px; max-width: 1140px; margin: 0 auto; padding: 36px 22px 20px; }
.feature-card { padding: 28px; border-radius: var(--radius-xl); overflow: hidden; }
.feature-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -60px; top: -70px; border-radius: 50%; background: var(--grad); opacity: .08; transition: transform var(--dur-3) var(--ease-out), opacity var(--transition); }
.feature-card:hover::after { transform: scale(1.5); opacity: .15; }
.feature-card .f-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--grad); color: var(--accent-contrast); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 34%, transparent); transition: transform var(--dur-3) var(--ease-spring); }
.feature-card:hover .f-icon { transform: scale(1.1) rotate(-6deg); } .feature-card .f-icon .icon { width: 24px; height: 24px; }
.feature-card h3 { font-size: 16.5px; } .feature-card p { font-size: 14px; line-height: 1.6; position: relative; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); gap: 20px; max-width: 1140px; margin: 0 auto; padding: 36px 22px 76px; }
.plan-card { padding: 30px 26px; text-align: center; position: relative; border-radius: var(--radius-xl); }
.plan-card.popular { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent), var(--shadow), var(--glow); transform: translateY(-6px); }
/* v5.0.0 — « nouveau » revient COMME AVANT : pastille flottante à cheval sur
   le bord supérieur de la carte (position absolue, plus rien dans le flux →
   plus AUCUN décalage vertical entre les cartes de prix). Correction demandée :
   top:-4px (au lieu de -12px auparavant) — juste ce qui faut pour que la
   pastille ne soit ni coupée ni poussée vers le bas. */
.plan-card .plan-flag { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); margin: 0; z-index: 2; background: var(--grad); color: var(--accent-contrast); font-size: 11.5px; font-weight: 720; letter-spacing: .05em; text-transform: uppercase; padding: 5px 14px; border-radius: 999px; box-shadow: var(--shadow-sm); white-space: nowrap; }
.plan-card.popular .plan-flag { box-shadow: var(--shadow-sm), 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.plan-card .price { font-size: 34px; font-weight: 800; margin: 10px 0 4px; letter-spacing: -.035em; } .plan-card .p-name { font-weight: 720; font-size: 16px; }
.plan-card ul { list-style: none; padding: 0; margin: 18px 0 22px; font-size: 13.5px; color: var(--text-soft); text-align: left; } .plan-card li { padding: 6px 0; display: flex; align-items: flex-start; gap: 9px; }
.plan-card li::before { content: ""; flex: none; width: 17px; height: 17px; margin-top: 2px; background: var(--accent-soft); border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--accent); }
.landing-footer { border-top: 1px solid var(--glass-border); padding: 30px 22px; text-align: center; color: var(--text-faint); font-size: 13px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.landing-footer a { color: var(--text-soft); } .landing-footer a:hover { color: var(--accent-text); }

.public-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.public-top { padding: 20px 28px; } .public-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); } .public-brand img { width: 32px; height: 32px; border-radius: 10px; }
.public-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 12px 16px 48px; }
.public-card { width: min(700px, 100%); padding: 32px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg), var(--glass-hi); background: var(--glass-strong); animation: nvCardIn 600ms var(--ease-out) both; }
.public-title { font-size: 20px; margin: 0 0 4px; }
.public-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0 4px; color: var(--text-soft); font-size: 13.5px; }

/* ================================================================
   Animations d'entrée, impression, mouvement réduit
   ================================================================ */
.page > * { animation: nvRise 520ms var(--ease-out) both; }
.page > *:nth-child(2) { animation-delay: 60ms; } .page > *:nth-child(3) { animation-delay: 110ms; } .page > *:nth-child(4) { animation-delay: 160ms; }
.page > *:nth-child(5) { animation-delay: 200ms; } .page > *:nth-child(n+6) { animation-delay: 240ms; }
@keyframes nvRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stat-cards > *, .shortcut-grid > *, .charts-grid > *, .recent-strip > *, .features-grid > *, .plans-grid > *, .orgs-grid > * { animation: nvRise 560ms var(--ease-out) both; }
.stat-cards > :nth-child(2), .shortcut-grid > :nth-child(2), .charts-grid > :nth-child(2), .recent-strip > :nth-child(2), .features-grid > :nth-child(2), .plans-grid > :nth-child(2), .orgs-grid > :nth-child(2) { animation-delay: 70ms; }
.stat-cards > :nth-child(3), .shortcut-grid > :nth-child(3), .charts-grid > :nth-child(3), .recent-strip > :nth-child(3), .features-grid > :nth-child(3), .plans-grid > :nth-child(3), .orgs-grid > :nth-child(3) { animation-delay: 140ms; }
.stat-cards > :nth-child(4), .shortcut-grid > :nth-child(4), .recent-strip > :nth-child(4), .features-grid > :nth-child(4), .plans-grid > :nth-child(4) { animation-delay: 210ms; }
.stat-cards > :nth-child(n+5), .recent-strip > :nth-child(n+5), .features-grid > :nth-child(n+5) { animation-delay: 270ms; }
.files-table tbody tr, .files-grid .file-card, .notes-grid .note-card { animation: nvRowIn 380ms var(--ease-out) backwards; }
.files-table tbody tr:nth-child(2), .files-grid .file-card:nth-child(2), .notes-grid .note-card:nth-child(2) { animation-delay: 40ms; }
.files-table tbody tr:nth-child(3), .files-grid .file-card:nth-child(3), .notes-grid .note-card:nth-child(3) { animation-delay: 80ms; }
.files-table tbody tr:nth-child(4), .files-grid .file-card:nth-child(4), .notes-grid .note-card:nth-child(4) { animation-delay: 120ms; }
.files-table tbody tr:nth-child(n+5), .files-grid .file-card:nth-child(n+5), .notes-grid .note-card:nth-child(n+5) { animation-delay: 160ms; }
@keyframes nvRowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media print { .sidebar, .topbar, .bulk-bar, .upload-panel, .toast-stack, body::before, body::after { display: none !important; } .page { padding: 0; max-width: none; } .card { box-shadow: none; backdrop-filter: none; background: #fff; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .stat-spark path.s-line { stroke-dashoffset: 0; } .stat-spark path.s-area { opacity: 1; }
}
/* Sans support de backdrop-filter : surfaces plus opaques pour garder la lisibilité */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: var(--bg-elevated); --glass-strong: var(--bg-elevated); --sidebar-bg: var(--bg-elevated); --topbar-bg: var(--bg-elevated); }
}
@media (max-width: 640px) { body::before { animation: none; } .hero-mock .hm-window { transform: none; animation: none; } }

/* Chargement initial : aucun repli animé tant que l'état mémorisé n'est pas appliqué */
.nv-no-anim .tree-collapse, .nv-no-anim .nav-caret .icon, .nv-no-anim .tree-caret .icon { transition: none !important; }

/* Garde-fous de mise en page : aucun enfant ne doit élargir la page (bandes défilantes, tableaux…) */
.app-main { overflow-x: clip; }
.page { min-width: 0; }
.page > * { min-width: 0; max-width: 100%; }

/* Cellule d'actions : doit rester une vraie cellule de tableau (sinon la ligne se décale) */
@media (min-width: 721px) {
  td.cell-actions { display: table-cell; vertical-align: middle; text-align: right; white-space: nowrap; }
  td.cell-actions > * { vertical-align: middle; }
}
.landing-hero > img { display: block; margin: 0 auto 20px; }
.theme-grid + .tm-title { margin-top: 4px; }
.palette-picker { margin-bottom: 12px; }
#pf-save { margin-top: 16px; }

/* =====================================================================
   v2.8.0 — Visualiseur v3 · Penses-bêtes glisser-déposer · Page publique
   (liste/miniatures/mosaïque) · Console des offres repensée
   ===================================================================== */

/* ------------------------------------------------------------ Visualiseur v3 */
.pv-head { gap: 12px; }
.pv-head .pv-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pv-head .pv-head-main h3 { margin: 0; }
.pv-head-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-faint); flex-wrap: wrap; }
.pv-head-actions { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.pv-file-chip {
  width: 38px; height: 38px; flex: none; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.pv-cat-badge {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent-text);
}
.pv-cat-video, .pv-cat-audio { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.pv-cat-image { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.pv-editbar {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 7px 9px; z-index: 6;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 13px;
  box-shadow: var(--shadow-lg), var(--glass-hi); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  animation: popIn 200ms var(--ease-spring); max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: center;
}
.pv-editbar .icon-mini-btn { width: 34px; height: 34px; }
.pv-editbar-text .btn .icon { width: 15px; height: 15px; margin-right: 2px; }
.preview-stage .pv-textarea {
  width: calc(100% - 32px); height: calc(100% - 96px); margin: 16px; resize: none;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6; border-radius: 12px;
}
.preview-stage .pv-text .ln { display: inline-block; min-width: 3.2em; color: var(--text-faint); user-select: none; }
.preview-stage .pv-md { width: 100%; max-width: 860px; margin: 0 auto; padding: 26px 30px; overflow: auto; font-size: 14px; line-height: 1.65; }
.preview-stage .pv-md h1, .preview-stage .pv-md h2, .preview-stage .pv-md h3 { margin: 1em 0 .4em; line-height: 1.25; }
.preview-stage .pv-md h1 { font-size: 1.55em; } .preview-stage .pv-md h2 { font-size: 1.3em; } .preview-stage .pv-md h3 { font-size: 1.12em; }
.preview-stage .pv-md p { margin: .55em 0; }
.preview-stage .pv-md ul, .preview-stage .pv-md ol { margin: .55em 0; padding-left: 1.5em; }
.preview-stage .pv-md blockquote { margin: .8em 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 8px; color: var(--text-soft); }
.preview-stage .pv-md code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; }
.preview-stage .pv-md pre { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow: auto; }
.preview-stage .pv-md pre code { border: 0; background: transparent; padding: 0; }
.preview-stage .pv-md hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.preview-stage .pv-md a { color: var(--accent-text); }

/* ------------------------------------------------------------ Penses-bêtes : glisser-déposer */
/* v3.1.1 — bouton d'ouverture d'une pense-bête (remplace le rôle « button »
   de la carte, qui contenait des boutons :WCAG « nested-interactive »). */
.note-open {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 6px;
}
.note-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.note-card { cursor: grab; }
.note-card:active { cursor: grabbing; }
.note-card.dragging { opacity: .45; transform: scale(.98) rotate(1.2deg); box-shadow: var(--shadow-lg); z-index: 4; }
.note-card.drag-over { outline: 2px dashed var(--accent); outline-offset: 3px; }
.notes-grid .empty-state { cursor: default; }

/* ------------------------------------------------------------ Page publique : fenêtre de contenu */

/* v3.1.1 — VISIONNEUSE PUBLIQUE : le contenu tient DANS la fenêtre.
   Avant, la page d'un fichier partagé empilait des hauteurs FIGÉES
   (iframe PDF 560 px, image 440 px, texte 420 px) : sur un écran de
   720 px de haut la page mesurait 1000 px, l'aperçu était coupé et
   l'utilisateur devait faire défiler pour voir la fin du document.
   → la page d'un fichier devient une colonne flex qui occupe exactement
   la fenêtre (100 dvh) ; la carte se borne à l'espace restant et la
   zone de visionnage REMPLIT cet espace (flex: 1 ; min-height: 0).
   Aucun contenu n'est masqué : le cadre PDF se réduit pour tenir dans
   l'espace disponible, le texte long défile à l'intérieur de son cadre. */
.public-page--file { height: 100vh; height: 100dvh; }
.public-page--file .public-main { flex: 1 1 auto; min-height: 0; padding-bottom: 14px; }
.public-card--file { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.public-card--file .public-title { flex: none; }
.public-card--file .public-meta,
.public-card--file > .text-faint { flex: none; }

.pub-viewer {
  flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center;
  margin-top: 16px; min-width: 0;
}
.pub-viewer-frame {
  width: 100%; height: 100%; min-height: 220px; border: 1px solid var(--border);
  border-radius: 12px; background: #fff;
}
.pub-viewer-media { width: 100%; max-height: 100%; border-radius: 12px; background: #000; }
.pub-viewer-audio { width: 100%; padding: 26px 0; }
.pub-viewer-audio audio { width: 100%; }
/* Le lien conteneur de l'image doit s'étirer sur la hauteur disponible,
   sinon « max-height: 100 % » de l'image n'a aucune base de calcul et
   l'image déborde de l'écran sur les petits écrans. */
.pub-viewer-link { display: flex; align-items: center; justify-content: center; align-self: stretch; height: 100%; max-height: 100%; min-height: 0; }
.pub-viewer-img {
  max-width: 100%; max-height: 100%; display: block; margin: 0 auto;
  border-radius: 12px; box-shadow: var(--shadow-lg); object-fit: contain;
}
.pub-viewer-text {
  width: 100%; height: 100%; min-height: 0; overflow: auto; margin: 0; padding: 16px;
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 12px;
  font-family: var(--font-mono); font-size: 12.8px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; box-sizing: border-box;
}
/* Sur très petits écrans, la visionneuse garde une hauteur minimale utile :
   le document reste entièrement atteignable par défilement de la page. */
@media (max-width: 640px) {
  .public-page--file .public-main { padding-bottom: 10px; }
  .public-card--file { padding: 20px; }
  .pub-viewer-frame { min-height: 180px; }
}

/* v3.1.1 — la fenêtre de contenu du dossier partagé se borne à la place
   restante dans la fenêtre du navigateur et défile à l'intérieur. */
.public-card--file .pub-files-window { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.public-card--file .pub-files-body { flex: 1 1 auto; min-height: 0; max-height: none; }
.pub-files-window { border-radius: var(--radius-lg); }
.pub-files-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-sunken) 55%, transparent);
}
.pub-files-count { font-size: 12.8px; font-weight: 650; color: var(--text-soft); }
.pub-files-spacer { flex: 1; }
.pub-view-switch { display: inline-flex; gap: 3px; padding: 3px; background: var(--bg-sunken); border-radius: 11px; border: 1px solid var(--border); }
.pub-view-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; min-height: 32px;
  border: 0; background: transparent; border-radius: 8px; font: inherit; font-size: 12.6px; font-weight: 620;
  color: var(--text-soft); cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast);
}
.pub-view-btn:hover { color: var(--text); background: var(--bg-hover); }
.pub-view-btn.active { color: var(--accent-contrast); background: var(--grad); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); }
.pub-view-btn .icon { width: 15px; height: 15px; }

.pub-files-body { max-height: 480px; overflow-y: auto; overscroll-behavior: contain; }
.pub-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; font: inherit; color: inherit; text-align: left; }
.pub-files-body > :last-child { border-bottom: 0; }
.pub-row-folder { cursor: default; }
.pub-row-file { cursor: pointer; transition: background var(--transition-fast); position: relative; }
.pub-row-file:hover, .pub-row-file:focus-visible { background: var(--bg-hover); outline: none; }
.pub-row-icon { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg-sunken); color: var(--text-soft); }
.pub-row-main { flex: 1; min-width: 0; }
.pub-row-name { font-weight: 580; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-row-sub { font-size: 11.8px; color: var(--text-faint); margin-top: 1px; }
.pub-row-dl {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft); cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast);
}
.pub-row-dl:hover { background: var(--accent-soft); color: var(--accent-text); }
.pub-thumb { display: none; }

/* Miniatures */
/* v3.3.0 — CORRECTIF HAUTEURS (vue publique) : les pistes « auto » de la
   grille étaient COMPIMÉES pour tenir dans la fenêtre (les cartes à
   overflow:hidden ont une taille minimale nulle) : les vignettes s'écrasaient
   — jusqu'à disparaître sur mobile. Pistes dimensionnées sur le CONTENU :
   la fenêtre défile au lieu d'écraser les cartes ; gabarits alignés sur
   ceux de l'application (miniatures 132 px, mosaïque 180 px). */
.pub-files-body.pub-view-grid, .pub-files-body.pub-view-mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 14px; padding: 14px; }
.pub-files-body.pub-view-mosaic { grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 16px; }
.pub-files-body.pub-view-grid .pub-row, .pub-files-body.pub-view-mosaic .pub-row {
  flex-direction: column; align-items: stretch; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-elevated); cursor: pointer;
}
.pub-files-body.pub-view-grid .pub-row:hover, .pub-files-body.pub-view-mosaic .pub-row:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pub-files-body.pub-view-grid .pub-thumb, .pub-files-body.pub-view-mosaic .pub-thumb {
  display: flex; align-items: center; justify-content: center; height: 132px; background: var(--grad-soft); position: relative; overflow: hidden;
}
.pub-files-body.pub-view-mosaic .pub-thumb { height: 180px; }
.pub-files-body.pub-view-grid .pub-thumb img, .pub-files-body.pub-view-mosaic .pub-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease-out); }
.pub-files-body.pub-view-grid .pub-row:hover .pub-thumb img, .pub-files-body.pub-view-mosaic .pub-row:hover .pub-thumb img { transform: scale(1.06); }
.pub-thumb.pub-thumb-fallback, .pub-thumb:empty { color: var(--accent); }
.pub-thumb.pub-thumb-fallback::before { content: ""; width: 46px; height: 46px; background: var(--accent-soft); border-radius: 10px; }
.pub-files-body.pub-view-grid .pub-row-icon, .pub-files-body.pub-view-mosaic .pub-row-icon { display: none; }
.pub-files-body.pub-view-grid .pub-row-main, .pub-files-body.pub-view-mosaic .pub-row-main { padding: 9px 11px; }
.pub-files-body.pub-view-grid .pub-row-name, .pub-files-body.pub-view-mosaic .pub-row-name { white-space: nowrap; font-size: 13px; }
.pub-files-body.pub-view-mosaic .pub-row-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.pub-files-body.pub-view-grid .pub-row-sub, .pub-files-body.pub-view-mosaic .pub-row-sub { margin-top: 2px; }
.pub-files-body.pub-view-grid .pub-row-dl, .pub-files-body.pub-view-mosaic .pub-row-dl {
  position: absolute; top: 7px; right: 7px; background: var(--glass-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm); opacity: 0; transition: opacity var(--transition-fast);
}
.pub-row-file:hover .pub-row-dl, .pub-row-file:focus-visible .pub-row-dl { opacity: 1; }
@media (hover: none) { .pub-files-body .pub-row-dl { opacity: 1; } }

/* Modale d'aperçu publique */
.pub-modal { position: fixed; inset: 0; z-index: 120; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fadeIn 160ms ease; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pub-modal[hidden] { display: none; }
.pub-modal-card {
  width: 100%; max-width: 980px; max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); display: flex; flex-direction: column;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--glass-hi); backdrop-filter: blur(28px) saturate(1.7); -webkit-backdrop-filter: blur(28px) saturate(1.7);
  animation: popIn 240ms var(--ease-spring);
}
.pub-modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex: none; }
.pub-modal-title { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-modal-sub { font-size: 12.3px; color: var(--text-faint); flex: none; }
.pub-modal-close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background var(--transition-fast), color var(--transition-fast); }
.pub-modal-close:hover { background: var(--bg-hover); color: var(--text); }
/* v3.0.0 — CORRECTIF DÉBORDEMENT : le corps de la fenêtre d'aperçu publique ne
   doit jamais pousser le contenu hors de l'écran. align-items:center + contenu
   plus grand que le conteneur = débordement EN HAUT et EN BAS (partie haute
   inatteignable). margin:auto sur les enfants centre quand il y a la place et
   colle au bord haut (scrollable) quand le contenu est plus grand. */
.pub-modal-body { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; background: color-mix(in srgb, var(--bg-sunken) 80%, transparent); position: relative; }
.pub-modal-body > * { margin: auto 0; max-width: 100%; }
/* v3.1.0 — CORRECTIF DÉBORDEMENT IMAGE : une image très grande dépassait la
   fenêtre (max-height estimé en vh ≠ hauteur réellement disponible). Désormais,
   en mode image, l'img REMPLIT EXACTEMENT l'espace restant de la fenêtre
   (position absolue dans le corps) : impossible de déborder, quel que soit
   l'écran — object-fit:contain conserve les proportions. */
.pub-modal-body.pub-has-image { overflow: hidden; display: block; }
.pub-modal-body.pub-has-image .pub-pv-img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  object-fit: contain; margin: 0; border-radius: 0;
}
.pub-modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 12px 18px; border-top: 1px solid var(--border); flex: none; }
/* v3.3.0 — APERÇU PUBLIC RÉPARÉ : la fenêtre d'aperçu reçoit une hauteur
   DÉFINIE pour les médias (image / vidéo / PDF / texte). L'image en position
   absolue (pub-has-image) — comme les médias « 100 % de hauteur » — exigeait
   une hauteur de carte définie : sans elle, le corps de l'aperçu s'effondrait
   à 0 px et le visualiseur semblait ne rien afficher. La classe « pub-fill »
   est posée par le JS selon le type de fichier affiché. */
.pub-modal.pub-fill .pub-modal-card { height: calc(100vh - 36px); height: calc(100dvh - 36px); }
.pub-modal.pub-fill .pub-modal-body { align-items: stretch; }
.pub-modal.pub-fill .pub-pv-media { height: 100%; margin: 0; }
.pub-modal.pub-fill .pub-pv-frame { height: 100%; min-height: 0; flex: 1 1 auto; }
.pub-modal.pub-fill .pub-pv-text { flex: 1 1 auto; min-height: 0; }
.pub-pv-loading { padding: 48px; color: var(--text-faint); font-size: 13.5px; }
.pub-pv-empty { padding: 44px 24px; color: var(--text-faint); font-size: 13.5px; text-align: center; }
/* v3.0.0 — repli `vh` AVANT `dvh` : sans lui, les navigateurs sans support dvh
   ignorent la déclaration et le visualiseur déborde de l'écran (partagé par lien). */
/* v3.1.1 — les médias occupent l'espace RÉELLEMENT disponible dans la fenêtre
   d'aperçu. Avant, la hauteur était DÉDUITE du viewport (100dvh - N px) alors
   que la fenêtre elle-même est bornée par max-height : sur un écran bas, le
   cadre PDF (min-height 320 px) dépassait la fenêtre et la partie basse était
   coupée. → le cadre et le texte s'étirent sur la hauteur restante. */
.pub-pv-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pub-pv-media { width: 100%; max-height: 100%; background: #000; }
.pub-pv-frame { width: 100%; height: auto; min-height: 200px; border: 0; background: #fff; }
.pub-pv-text { width: 100%; margin: 0; padding: 18px; font-family: var(--font-mono); font-size: 12.8px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 100%; overflow: auto; box-sizing: border-box; }
.pub-modal-body > .pub-pv-frame,
.pub-modal-body > .pub-pv-text { flex: 1 1 auto; align-self: stretch; margin: 0; }
.pub-modal-body > .pub-pv-frame { min-height: 200px; }
.pub-modal-body > .pub-pv-text { min-height: 0; }
.pub-pv-audio { width: min(560px, 94%); padding: 40px 0; }
@media (max-width: 640px) {
  .pub-modal { padding: 10px; }
  .pub-modal-card { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
  .pub-modal.pub-fill .pub-modal-card { height: calc(100vh - 20px); height: calc(100dvh - 20px); }
  .pub-modal-head { padding: 11px 13px; gap: 8px; }
  .pub-modal-foot { padding: 10px 13px; }
  .pub-pv-frame { min-height: 150px; }
}

/* ------------------------------------------------------------ Console des offres (refonte) */
.plans-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.plans-title { margin: 0 0 4px; font-size: 19px; }
.plans-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.plan-kpi { padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.plan-kpi-value { font-size: 22px; font-weight: 760; letter-spacing: -.02em; color: var(--accent-text); }
.plan-kpi-label { font-size: 12.3px; color: var(--text-faint); font-weight: 580; }
/* v3.1.0 — les offres couvrent TOUTE la largeur du conteneur, par lot de 3
   (2 colonnes sur écran moyen, 1 colonne sur mobile). */
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1180px) { .plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 840px) { .plans-grid { grid-template-columns: minmax(0, 1fr); } }
/* v3.1.0 — specs d'une offre : UNE LIGNE par caractéristique
   (Stockage (Go) / Taille max d'un fichier (Mo) / Versions conservées). */
.plan-spec { display: flex; flex-direction: column; margin: 2px 0 12px; }
.plan-spec-row { display: grid; grid-template-columns: minmax(0, 1fr) 132px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.plan-spec-row:last-child { border-bottom: 0; }
.plan-spec-k { font-size: 13px; font-weight: 640; color: var(--text-soft); overflow-wrap: anywhere; }
@media (max-width: 560px) { .plan-spec-row { grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; } }
/* v5.0.0 — plus d'overflow:hidden sur .plan-card : il tronquait la pastille
   flottante « nouveau » (top:-4px). Les coins arrondis du haut (dégradé) et
   du bas (fond) de la console des offres sont repris sur les sections elles-
   mêmes, ce qui rend le clipping inutile partout. */
.plan-card { display: flex; flex-direction: column; }
.plan-card.plan-inactive { opacity: .82; }
.plan-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px 14px; background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.plan-name-wrap { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 7px; }
.plan-name-input { font-weight: 680; font-size: 14.5px; }
.plan-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-price-display { font-size: 21px; font-weight: 780; letter-spacing: -.02em; color: var(--accent-text); white-space: nowrap; }
.plan-price-display .plan-cur { font-size: 12.5px; font-weight: 650; color: var(--text-faint); margin-left: 3px; }
.plan-price-display .plan-free { font-size: 15px; color: var(--text-soft); }
.plan-card-body { padding: 16px 18px; display: flex; flex-direction: column; flex: 1; }
.plan-grid2 { display: grid; grid-template-columns: 1fr; gap: 0; }
.plan-grid-price { display: grid; grid-template-columns: 1fr 96px; gap: 10px; }
.plan-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-switches { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.plan-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13.5px; cursor: pointer; }
.plan-card-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-sunken) 45%, transparent); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
@media (max-width: 560px) {
  .plan-grid3 { grid-template-columns: 1fr 1fr; }
  .plan-price-display { font-size: 18px; }
}

/* Compléments v2.8 : flex-spacer générique (pieds de cartes, barres d'outils) */
.spacer { flex: 1; }


/* ================================================================
   Compléments v2.9.0
   ================================================================ */

/* ---- Pastille de type de fichier sur les vignettes (préférence utilisateur) ---- */
.file-card .thumb { position: relative; }
/* v3.1.0 — pastille de COMPTAGE des dossiers (miniatures / mosaïque), coin bas-droit. */
.folder-count {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  font-size: 10.3px; font-weight: 700; line-height: 1; padding: 4px 8px; border-radius: 999px;
  background: var(--glass-strong); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border); color: var(--accent-text);
  box-shadow: var(--shadow-sm); pointer-events: none;
}
.cat-badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10.3px; font-weight: 700; letter-spacing: .02em; line-height: 1;
  padding: 4px 7px; border-radius: 999px;
  background: var(--glass-strong); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border); color: var(--text-soft);
  box-shadow: var(--shadow-sm); pointer-events: none;
}
.cat-badge.cat-image { color: #0d9488; } .cat-badge.cat-video { color: #b45309; }
.cat-badge.cat-audio { color: #7c3aed; } .cat-badge.cat-pdf { color: #b91c1c; }
.cat-badge.cat-document { color: #1d4ed8; } .cat-badge.cat-archive { color: #a16207; }
.cat-badge.cat-text { color: #334155; } .cat-badge.cat-folder { color: var(--accent-text); }
[data-theme="dark"] .cat-badge.cat-image { color: #5eead4; }
[data-theme="dark"] .cat-badge.cat-video { color: #fcd34d; }
[data-theme="dark"] .cat-badge.cat-audio { color: #c4b5fd; }
[data-theme="dark"] .cat-badge.cat-pdf { color: #fca5a5; }
[data-theme="dark"] .cat-badge.cat-document { color: #93c5fd; }
[data-theme="dark"] .cat-badge.cat-text { color: #cbd5e1; }

/* ---- Sélecteur de langue de la barre supérieure (connecté) ---- */
.lang-dd .icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.lang-cur { position: absolute; right: 3px; bottom: 2px; font-size: 8.6px; font-weight: 800; letter-spacing: .03em; color: var(--accent-text); background: var(--accent-soft); border-radius: 999px; padding: 1.5px 4px; line-height: 1; }
.lang-dd .dd-item { display: flex; align-items: center; gap: 8px; }
.lang-dd .dd-item.active { color: var(--accent-text); font-weight: 650; }
.lang-dd .lang-slot { width: 16px; flex: none; display: inline-block; }
.lang-dd .icon { width: 15px; height: 15px; flex: none; }

/* ---- Partage public : fil d'ariane + navigation + dossiers cliquables ---- */
.pub-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 12px; padding: 9px 13px; border-radius: var(--radius);
  background: var(--bg-sunken); border: 1px solid var(--border);
  font-size: 13px; overflow-x: auto; max-width: 100%;
}
.pub-breadcrumb a { display: inline-flex; align-items: center; gap: 5px; color: var(--text-soft); text-decoration: none; padding: 2px 4px; border-radius: 7px; white-space: nowrap; }
.pub-breadcrumb a:hover { color: var(--accent-text); background: var(--bg-hover); }
.pub-crumb-root { font-weight: 680; color: var(--text) !important; }
.pub-crumb-sep { color: var(--text-faint); user-select: none; }
.pub-row-folder { cursor: pointer; text-decoration: none; color: inherit; transition: background var(--transition-fast); }
.pub-row-folder:hover, .pub-row-folder:focus-visible { background: var(--bg-hover); outline: none; }
.pub-row-folder:hover .pub-row-name { color: var(--accent-text); }
.pub-thumb-folder { display: none; align-items: center; justify-content: center; color: var(--accent); }
.pub-files-body.pub-view-grid .pub-thumb-folder, .pub-files-body.pub-view-mosaic .pub-thumb-folder { display: flex; }
.pub-files-body.pub-view-grid .pub-thumb-folder .icon, .pub-files-body.pub-view-mosaic .pub-thumb-folder .icon { width: 46px; height: 46px; }
.pub-files-body.pub-view-mosaic .pub-thumb-folder .icon { width: 60px; height: 60px; }
/* Pastille de type côté page publique */
.pub-cat-badge {
  flex: none; font-size: 10.3px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 999px;
  background: var(--bg-sunken); border: 1px solid var(--border); color: var(--text-soft);
}
.pub-files-body.pub-view-grid .pub-cat-badge, .pub-files-body.pub-view-mosaic .pub-cat-badge { display: none; }

/* ---- Réglage « pastille de type » : interrupteur + libellé alignés ---- */
.switch-row { display: flex; align-items: flex-start; gap: 12px; min-height: 32px; padding-top: 2px; }
.switch-row .switch { flex: none; }
.switch-row .hint { flex: 1; min-width: 0; }

/* ---- Sélecteur de langue des pages d'authentification (v2.9.0) ---- */
.auth-lang { display: flex; justify-content: flex-end; gap: 7px; margin-bottom: 6px; }
.auth-lang-btn {
  font-size: 12.3px; font-weight: 640; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-soft); text-decoration: none;
  background: var(--glass); transition: all var(--transition-fast); min-height: 30px;
  display: inline-flex; align-items: center;
}
.auth-lang-btn:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.auth-lang-btn.active { background: var(--grad); color: var(--accent-contrast); border-color: transparent; font-weight: 700; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); }

/* ================================================================
   Compléments v3.0.0
   ================================================================ */

/* ---- Visualiseur : infobulles de la barre d'outils du HAUT ---- */
/* La scène (.preview-stage) a overflow:hidden : l'infobulle standard (placée
   AU-DESSUS du bouton) était rognée. Dans la barre du haut, l'infobulle est
   désormais placée EN DESSOUS du bouton (dans la scène). */
.pv-toolbar .tooltip::after { bottom: auto; top: calc(100% + 7px); }
.pv-toolbar .tooltip:hover::after { transform: translateX(-50%) scale(1); }
.pv-toolbar .tooltip::before {
  content: ""; position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--text); opacity: 0; pointer-events: none; transition: opacity 140ms; z-index: 95;
}
.pv-toolbar .tooltip:hover::before { opacity: 1; }

/* ---- Sidebar : menu burger de chaque dossier (arborescence) ---- */
.tree-dd { display: inline-flex; flex: none; margin-left: auto; }
.tree-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-faint); cursor: pointer;
  opacity: 0; transition: opacity var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
.tree-menu-btn .icon { width: 13px; height: 13px; }
.tree-row:hover .tree-menu-btn, .tree-menu-btn:focus-visible, .tree-dd.open .tree-menu-btn { opacity: 1; }
.tree-menu-btn:hover { background: var(--bg-active); color: var(--text); }
.tree-row.active .tree-menu-btn { color: var(--accent-text); }
.tree-dd .dd-menu { min-width: 190px; }
@media (hover: none) {
  .tree-menu-btn { opacity: 1; width: 24px; height: 24px; } /* tactile : toujours visible */
}

/* ---- Barre supérieure : menu « notifications » (cloche) ---- */
.notif-dd .icon-btn { position: relative; }
.notif-menu { width: min(360px, calc(100vw - 24px)); padding: 0; }
/* Le menu flottant est une colonne : en-tête fixe, liste défilante, pied FIXE.
   Sans cela le pied « Afficher tout » tombait hors de la zone visible et
   n'était atteignable qu'au défilement de la liste. */
.dd-menu--floating.notif-menu { display: flex; flex-direction: column; max-height: min(65vh, 460px); overflow: hidden; }
.notif-menu .dd-head { padding: 11px 14px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border); flex: none; }
.notif-menu-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
.notif-item {
  display: flex; align-items: flex-start; gap: 9px; width: 100%;
  padding: 9px 14px; border: 0; background: transparent; cursor: pointer;
  font: inherit; color: var(--text); text-align: left;
  transition: background var(--transition-fast);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item .notif-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: transparent; margin-top: 6px; }
.notif-item.unread .notif-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.notif-item .notif-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-item .notif-title { font-size: 13px; font-weight: 560; line-height: 1.35; overflow-wrap: anywhere; }
.notif-item.unread .notif-title { font-weight: 680; }
.notif-item .notif-body { font-size: 12.2px; color: var(--text-faint); line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item .notif-time { flex: none; font-size: 11.2px; color: var(--text-faint); margin-top: 2px; white-space: nowrap; }
.notif-item.notif-act { cursor: default; }
.notif-item.notif-act:hover { background: transparent; }
.notif-item.notif-act .notif-title { font-weight: 520; color: var(--text-soft); }
.notif-sep { height: 1px; background: var(--border); margin: 6px 0; }
.notif-sec { padding: 5px 14px 3px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.notif-empty { padding: 26px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }
.notif-menu-foot { flex: none; padding: 10px 12px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-sunken) 55%, transparent); }

/* ---- Widget penses-bêtes du tableau de bord : un seul bouton burger ---- */
.note-foot-menu { display: flex; justify-content: flex-end; align-items: center; }
.note-foot-menu .note-dd { display: inline-flex; }
.note-burger { color: var(--text-faint); }
.note-burger:hover, .note-dd.open .note-burger { color: var(--text); }
.note-dd .dd-menu { min-width: 168px; }

/* =====================================================================
   v3.1.1 — Éditeur de texte riche (assets/js/editor.js)
   Barre d'outils, surface de mise en forme, mode source, recherche.
   ===================================================================== */
.nv-editor {
  position: relative; display: flex; flex-direction: column; min-height: 0;
  height: 100%; width: 100%; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.nv-editor-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 10px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-sunken) 60%, transparent);
}
.nv-editor-tabs { display: inline-flex; gap: 3px; padding: 3px; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 10px; flex: none; }
.nv-editor-tab {
  border: 0; background: transparent; border-radius: 7px; padding: 5px 11px; min-height: 30px;
  font: inherit; font-size: 12.4px; font-weight: 640; color: var(--text-soft); cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nv-editor-tab:hover:not(:disabled) { color: var(--text); background: var(--bg-hover); }
.nv-editor-tab.active { color: var(--accent-contrast); background: var(--grad); }
.nv-editor-tab:disabled { opacity: .45; cursor: not-allowed; }
.nv-editor-tools {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0;
}
.nv-editor-btn {
  width: 30px; height: 30px; flex: none; padding: 0; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--text-soft); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.nv-editor-btn .icon { width: 15px; height: 15px; }
.nv-editor-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border); }
.nv-editor-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nv-editor-sep { width: 1px; height: 20px; background: var(--border); margin: 0 5px; flex: none; }
.nv-editor-actions { display: inline-flex; gap: 7px; flex: none; margin-left: auto; }

.nv-editor-body { flex: 1 1 auto; min-height: 0; position: relative; display: flex; }
.nv-editor-wysiwyg {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 20px 24px; outline: none;
  font-size: 14px; line-height: 1.65; color: var(--text);
}
.nv-editor-wysiwyg[hidden], .nv-editor-source[hidden] { display: none; }
.nv-editor-wysiwyg > *:first-child { margin-top: 0; }
.nv-editor-wysiwyg > *:last-child { margin-bottom: 0; }
.nv-editor-wysiwyg h1, .nv-editor-wysiwyg h2, .nv-editor-wysiwyg h3,
.nv-editor-wysiwyg h4, .nv-editor-wysiwyg h5, .nv-editor-wysiwyg h6 { margin: 1em 0 .4em; line-height: 1.25; }
.nv-editor-wysiwyg h1 { font-size: 1.6em; } .nv-editor-wysiwyg h2 { font-size: 1.35em; }
.nv-editor-wysiwyg h3 { font-size: 1.15em; }
.nv-editor-wysiwyg p, .nv-editor-wysiwyg ul, .nv-editor-wysiwyg ol, .nv-editor-wysiwyg blockquote { margin: .55em 0; }
.nv-editor-wysiwyg ul, .nv-editor-wysiwyg ol { padding-left: 1.6em; }
.nv-editor-wysiwyg blockquote { padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 8px; color: var(--text-soft); }
.nv-editor-wysiwyg code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; }
.nv-editor-wysiwyg pre { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; overflow: auto; white-space: pre-wrap; }
.nv-editor-wysiwyg pre code { border: 0; background: transparent; padding: 0; }
.nv-editor-wysiwyg a { color: var(--accent-text); }
.nv-editor-wysiwyg img { max-width: 100%; border-radius: 8px; }
.nv-editor-wysiwyg hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.nv-editor-wysiwyg table { border-collapse: collapse; }
.nv-editor-wysiwyg td, .nv-editor-wysiwyg th { border: 1px solid var(--border); padding: 5px 10px; }
.nv-editor-source {
  flex: 1 1 auto; min-height: 0; width: 100%; resize: none; border: 0; outline: none;
  padding: 18px 20px; background: var(--bg-elevated); color: var(--text);
  font-family: var(--font-mono); font-size: 12.9px; line-height: 1.62; tab-size: 2;
}
.nv-editor-status {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 12px; border-top: 1px solid var(--border); background: var(--bg-sunken);
  font-size: 11.6px; color: var(--text-faint);
}
.nv-editor-msg.is-warn { color: var(--warning); font-weight: 620; }

/* Menus contextuels (couleurs, polices, tailles) */
.nv-editor-pop {
  position: absolute; z-index: 40; display: flex; flex-wrap: wrap; gap: 5px;
  padding: 9px; min-width: 176px; max-width: 240px;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.nv-editor-list { flex-direction: column; }
.nv-editor-swatch { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; }
.nv-editor-swatch:hover { transform: scale(1.12); }
.nv-editor-menu-item {
  text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 6px 10px;
  font: inherit; font-size: 12.8px; color: var(--text); cursor: pointer;
}
.nv-editor-menu-item:hover { background: var(--bg-hover); }
.nv-editor-dialog { flex-direction: column; min-width: 260px; }
.nv-editor-dialog .label { margin-bottom: 5px; }
.nv-editor-dialog .cluster { justify-content: flex-end; }

/* Recherche et remplacement */
.nv-editor-find {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--bg-sunken);
}
.nv-editor-find[hidden] { display: none; }
.nv-editor-find .nv-find-input { flex: 1 1 150px; min-width: 110px; height: 32px; font-size: 12.5px; }
@media (max-width: 640px) {
  .nv-editor-bar { gap: 7px; }
  .nv-editor-actions { width: 100%; justify-content: flex-end; }
  .nv-editor-wysiwyg { padding: 14px 15px; }
}
