/* WynaGraph — vanilla CSS */


@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/inter-400.woff2') format('woff2');
}
 
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/inter-500.woff2') format('woff2');
}
 
/* Graisse utilisée par les titres de section, titres de cartes et la marque.
   Sans ce fichier, le navigateur substitue une graisse voisine. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/inter-600.woff2') format('woff2');
}
 
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/inter-700.woff2') format('woff2');
}

:root {
  --background: #042042;
  --foreground: #ffffff;
  --surface: rgba(29, 54, 85, 0.6);
  --tile: #142a45;
  --cyan: #42ebe2;
  --accent: #0dbac1;
  --muted: #1d3655;
  --muted-foreground: #aab4c0;
  --border: rgba(255, 255, 255, 0.12);
  --glow-cyan: 0 0 14px 2px rgba(66, 235, 226, 0.4);
  --shadow-tile: 0 8px 32px rgba(0, 0, 0, 0.4);
  --gradient-hero: radial-gradient(ellipse at 20% 0%, rgba(66, 235, 226, 0.15), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(13, 186, 193, 0.12), transparent 50%);
}


* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(4, 32, 66, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(62, 217, 222, 0.15);
}
.nav {
  max-width: 1200px; margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 600; letter-spacing: 0.02em; font-size: 1.1rem; }
.brand .dot { color: var(--cyan); }
.nav-links { display: flex; gap: 1.5rem; font-size: 0.9rem; color: var(--muted-foreground); }
.nav-links a:hover { color: var(--cyan); }

main { padding-top: 4.5rem; }

/* Hero */
.hero {
  background: var(--gradient-hero);
  padding: 5rem 1.5rem 3rem;
  text-align: center;
}
.hero-inner { max-width: 900px; margin: 0 auto; }
.eyebrow {
  display: inline-block;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--cyan); margin-bottom: 1.2rem;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600; line-height: 1.1; margin-bottom: 1.2rem;
}
h1 .accent { color: var(--cyan); }
.lead {
  font-size: 1.1rem; color: var(--muted-foreground);
  max-width: 640px; margin: 0 auto 2rem;
}
.btns { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 1.3rem; border-radius: 8px;
  font-size: 0.95rem; font-weight: 500;
  border: 1px solid var(--border); transition: all .2s;
  cursor: pointer; background: transparent; color: var(--foreground);
}
.btn-primary { background: var(--cyan); color: #042042; border-color: var(--cyan); }
.btn-primary:hover { box-shadow: var(--glow-cyan); transform: translateY(-1px); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

/* Sections */
.section { max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem; }
.section-title { font-size: 1.8rem; font-weight: 600; margin-bottom: 0.5rem; }
.section-sub { color: var(--muted-foreground); margin-bottom: 2rem; }

/* Grid */
.grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all .25s;
  display: flex; flex-direction: column;
}
.card:hover {
  border-color: rgba(66, 235, 226, 0.5);
  box-shadow: var(--shadow-tile), var(--glow-cyan);
  transform: translateY(-2px);
}
.card-thumb { height: 200px; background: var(--tile); position: relative; }
.card-body { padding: 1.2rem 1.3rem 1.4rem; }
.card-cat {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--cyan); margin-bottom: 0.4rem;
}
.card-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.4rem; }
.card-desc { color: var(--muted-foreground); font-size: 0.92rem; line-height: 1.5; }

/* Detail page */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.graph-frame {
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: 14px;
  height: 620px;
  overflow: hidden;
  position: relative;
}
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.3rem;
  font-size: 0.92rem;
}
.sidebar h3 { font-size: 1rem; margin-bottom: 0.8rem; color: var(--cyan); }
.sidebar ul { list-style: none; }
.sidebar li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
}
.sidebar li:last-child { border-bottom: none; }
.stats { display: flex; gap: 1.5rem; margin-top: 1rem; color: var(--muted-foreground); font-size: 0.88rem; }
.stats strong { color: var(--foreground); display: block; font-size: 1.4rem; }

/* About / readme */
.readme h2 { font-size: 1.4rem; margin: 2.2rem 0 0.8rem; color: var(--cyan); }
.readme p { color: var(--muted-foreground); line-height: 1.7; margin-bottom: 1rem; }
.readme ul { margin: 0 0 1rem 1.5rem; color: var(--muted-foreground); line-height: 1.8; }
.steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 1.5rem 0; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.2rem;
}
.step-num {
  display: inline-block; width: 32px; height: 32px; border-radius: 50%;
  background: var(--cyan); color: #042042; font-weight: 600;
  text-align: center; line-height: 32px; margin-bottom: 0.6rem;
}
table.fmt {
  width: 100%; border-collapse: collapse; margin: 1rem 0;
  background: var(--surface); border-radius: 8px; overflow: hidden;
}
table.fmt th, table.fmt td {
  padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
table.fmt th { background: var(--muted); color: var(--cyan); }
table.fmt td { color: var(--muted-foreground); }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem; padding: 2rem 1.5rem;
  text-align: center; color: var(--muted-foreground); font-size: 0.88rem;
}

.back-link { color: var(--cyan); font-size: 0.9rem; display: inline-block; margin-bottom: 1rem; }
.back-link:hover { text-decoration: underline; }

/* ═══════════ Page : index.html (accueil — cartes d'articles, bandeau Workspace) ═══════════ */

 
   .posts-grid {
      display: grid;
      gap: 1.25rem;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    .post-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 1.4rem 1.5rem 1.6rem;
      display: flex;
      flex-direction: column;
      gap: .5rem;
      transition: all .22s;
      text-decoration: none;
      color: inherit;
    }
    .post-card:hover {
      border-color: rgba(66,235,226,.5);
      box-shadow: var(--shadow-tile), var(--glow-cyan);
      transform: translateY(-2px);
    }
    .post-cat {
      font-size: .7rem;
      text-transform: uppercase;
      letter-spacing: .16em;
      color: var(--cyan);
      font-weight: 600;
    }
    .post-title {
      font-size: 1.1rem;
      font-weight: 600;
      line-height: 1.35;
      color: var(--foreground);
    }
    .post-excerpt {
      font-size: .9rem;
      color: var(--muted-foreground);
      line-height: 1.55;
      flex: 1;
    }
    .post-date {
      font-size: .78rem;
      color: var(--muted-foreground);
      margin-top: .4rem;
    }
    .post-graph-badge {
      display: inline-flex;
      align-items: center;
      gap: .3rem;
      font-size: .75rem;
      color: var(--cyan);
      background: rgba(66,235,226,.08);
      border: 1px solid rgba(66,235,226,.2);
      border-radius: 20px;
      padding: 3px 10px;
      width: fit-content;
      margin-top: .3rem;
    }

    /* Bandeau Workspace */
    .workspace-banner {
      background: linear-gradient(135deg, rgba(13,186,193,.15), rgba(66,235,226,.07));
      border: 1px solid rgba(66,235,226,.3);
      border-radius: 16px;
      padding: 2.5rem 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 2rem;
      flex-wrap: wrap;
    }
    .workspace-banner-text h3 {
      font-size: 1.3rem;
      font-weight: 600;
      margin-bottom: .5rem;
    }
    .workspace-banner-text p {
      color: var(--muted-foreground);
      font-size: .95rem;
      max-width: 480px;
      line-height: 1.6;
    }
    .workspace-banner-actions {
      display: flex;
      gap: .8rem;
      flex-wrap: wrap;
    }
  

/* ═══════════ Page : galerie.html (thèmes, recherche, bandeau import mode auteur) ═══════════ */

    .gallery-nav {
      display: flex;
      align-items: center;
      gap: .5rem;
      margin-bottom: 2rem;
      font-size: .9rem;
      color: var(--muted-foreground);
      flex-wrap: wrap;
    }
    .gallery-nav a, .gallery-nav button {
      background: none; border: none; padding: 0;
      color: var(--cyan); cursor: pointer;
      font-size: .9rem; font-family: inherit; text-decoration: none;
    }
    .gallery-nav a:hover, .gallery-nav button:hover { text-decoration: underline; }
    .gallery-nav .sep { color: var(--muted-foreground); }
    .gallery-nav .current { color: var(--foreground); font-weight: 600; }

    .group-grid {
      display: grid;
      gap: 1.1rem;
      grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }
    .group-tile {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 1.5rem 1.4rem;
      cursor: pointer;
      transition: all .22s;
      display: flex; flex-direction: column; gap: .5rem;
    }
    .group-tile:hover {
      border-color: rgba(66,235,226,.55);
      box-shadow: var(--shadow-tile), var(--glow-cyan);
      transform: translateY(-3px);
    }
    .group-tile-icon  { font-size: 1.5rem; line-height: 1; }
    .group-tile-name  { font-size: 1rem; font-weight: 600; color: var(--foreground); }
    .group-tile-count { font-size: .8rem; color: var(--muted-foreground); }
    .group-tile-cats  {
      font-size: .75rem; color: var(--muted-foreground);
      line-height: 1.5; border-top: 1px solid var(--border);
      padding-top: .5rem; margin-top: .2rem;
    }

    #graphs-view { display: none; }

    .cat-group-header {
      display: flex; align-items: center; gap: .7rem;
      margin: 2rem 0 1rem; grid-column: 1 / -1;
    }
    .cat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); flex-shrink: 0; }
    .cat-group-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .18em; color: var(--cyan); font-weight: 600; }
    .cat-group-line  { flex: 1; height: 1px; background: var(--border); }

    /* ── Import d'un graphe JSON depuis le Workspace ── */
    .import-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1.5rem;
      flex-wrap: wrap;
      background: rgba(66,235,226,.05);
      border: 1px dashed rgba(66,235,226,.35);
      border-radius: 14px;
      padding: 1.2rem 1.5rem;
      margin-bottom: 2rem;
    }
    /* L'attribut hidden doit l'emporter sur display:flex, sinon le bandeau
       (mode auteur) reste visible pour les visiteurs. */
    .import-banner[hidden] { display: none; }

    /* ── Recherche dans la galerie ── */
    #gallery-search-wrap {
      position: relative;
      max-width: 440px;
      margin: 1.2rem 0 2rem;
    }
    #gallery-search-icon {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted-foreground);
      font-size: .95rem;
      pointer-events: none;
    }
    #gallery-search {
      width: 100%;
      background: rgba(255,255,255,.05);
      border: 1px solid var(--border);
      border-radius: 24px;
      color: #fff;
      font-size: .92rem;
      font-family: inherit;
      padding: 10px 38px 10px 38px;
      outline: none;
      transition: border-color .15s, background .15s;
    }
    #gallery-search::placeholder { color: var(--muted-foreground); }
    #gallery-search:focus {
      border-color: var(--cyan);
      background: rgba(255,255,255,.08);
    }
    #gallery-search-clear {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: var(--muted-foreground);
      font-size: 1.05rem;
      line-height: 1;
      cursor: pointer;
      padding: 4px 6px;
      display: none;
    }
    #gallery-search-clear:hover { color: #fff; }
    #gallery-search-wrap.has-value #gallery-search-clear { display: block; }

    #search-view { display: none; }
    #search-view.active { display: block; }

    .search-empty {
      color: var(--muted-foreground);
      font-size: .95rem;
      line-height: 1.6;
      padding: 1.5rem 0;
    }
    .search-empty b { color: var(--foreground); }

    /* Résultats articles */
    .post-results {
      display: grid;
      gap: 1rem;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      margin-top: 1rem;
    }
    .post-result {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 1.2rem 1.3rem 1.35rem;
      display: flex;
      flex-direction: column;
      gap: .45rem;
      text-decoration: none;
      color: inherit;
      transition: all .22s;
    }
    .post-result:hover {
      border-color: rgba(66,235,226,.5);
      box-shadow: var(--shadow-tile), var(--glow-cyan);
      transform: translateY(-2px);
    }
    .post-result-cat {
      font-size: .68rem;
      text-transform: uppercase;
      letter-spacing: .16em;
      color: var(--cyan);
      font-weight: 600;
    }
    .post-result-title { font-size: 1.02rem; font-weight: 600; line-height: 1.35; color: var(--foreground); }
    .post-result-excerpt { font-size: .86rem; color: var(--muted-foreground); line-height: 1.55; }
    .import-banner-text b { color: var(--foreground); font-size: .95rem; }
    .import-banner-text p {
      color: var(--muted-foreground);
      font-size: .85rem;
      line-height: 1.55;
      margin-top: .25rem;
      max-width: 560px;
    }
    #gallery-import-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(66,235,226,.1);
      border: 1px solid rgba(66,235,226,.35);
      border-radius: 22px;
      color: var(--cyan);
      font-family: inherit;
      font-size: .88rem;
      font-weight: 600;
      padding: 9px 20px;
      cursor: pointer;
      white-space: nowrap;
      transition: background .15s, border-color .15s;
    }
    #gallery-import-btn:hover {
      background: rgba(66,235,226,.18);
      border-color: var(--cyan);
    }

  

/* ═══════════ Page : article.html ═══════════ */

    /* ── Layout article ── */
    .article-layout {
      display: grid;
      grid-template-columns: 1fr 420px;
      gap: 2rem;
      align-items: start;
    }
    @media (max-width: 960px) {
      .article-layout { grid-template-columns: 1fr; }
      .article-graph-col { order: -1; }
    }

    /* Colonne texte */
    .article-header { margin-bottom: 2rem; }
    .article-header .eyebrow { margin-bottom: .8rem; }
    .article-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; margin-bottom: 1rem; }
    .article-meta {
      display: flex;
      align-items: center;
      gap: 1rem;
      font-size: .85rem;
      color: var(--muted-foreground);
      flex-wrap: wrap;
    }
    .article-meta .sep { opacity: .4; }

    .article-body { font-size: 1rem; line-height: 1.75; color: #d0dbe8; }
    .article-body h3 {
      font-size: 1.15rem;
      font-weight: 600;
      color: var(--foreground);
      margin: 2rem 0 .7rem;
    }
    .article-body p { margin-bottom: 1.1rem; }
    .article-body ul {
      margin: 0 0 1.1rem 1.4rem;
      color: var(--muted-foreground);
      line-height: 1.8;
    }
    .article-body strong { color: var(--foreground); }

    /* Colonne graphe */
    .article-graph-col { position: sticky; top: 5.5rem; }
    .graph-card {
      background: var(--tile);
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
    }
    .graph-card-frame {
      height: 360px;
      position: relative;
    }
    .graph-card-footer {
      padding: 1rem 1.2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-top: 1px solid var(--border);
      gap: .8rem;
      flex-wrap: wrap;
    }
    .graph-card-title {
      font-size: .9rem;
      font-weight: 600;
      color: var(--foreground);
    }
    .graph-card-sub {
      font-size: .78rem;
      color: var(--muted-foreground);
    }

    /* Sidebar sélection (dans la carte graphe) */
    .graph-selection {
      padding: .9rem 1.2rem;
      border-top: 1px solid var(--border);
      min-height: 60px;
    }
    .graph-selection p { font-size: .84rem; color: var(--muted-foreground); margin: 0; }
    .graph-sel-title { font-size: .82rem; font-weight: 600; color: var(--foreground); margin-bottom: .4rem; }
    .graph-sel-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--cyan); margin-bottom: .5rem; }
    .graph-sel-list { list-style: none; padding: 0; margin: 0; }
    .graph-sel-list li {
      font-size: .82rem;
      padding: .3rem 0;
      border-bottom: 1px solid var(--border);
      color: var(--muted-foreground);
    }
    .graph-sel-list li:last-child { border-bottom: none; }
    .graph-rel-label { font-size: .72rem; color: var(--cyan); display: block; }

    /* Bandeau workspace bas d'article */
    .article-cta {
      margin-top: 3rem;
      background: rgba(66,235,226,.06);
      border: 1px solid rgba(66,235,226,.25);
      border-radius: 12px;
      padding: 1.4rem 1.6rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      flex-wrap: wrap;
    }
    .article-cta p { margin: 0; color: var(--muted-foreground); font-size: .92rem; }
    .article-cta strong { color: var(--foreground); }
  

/* ═══════════ Page : graph.html (vue graphe plein écran, panneau, import, toast) ═══════════ */

    /* ── Sidebar sélection harmonisée Workspace ── */
    .sel-relation-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 14px;
      font-size: .84rem;
      color: var(--muted-foreground);
    }
    .sel-relation-header b   { color: #fff; }
    .sel-relation-arrow {
      font-size: .75rem;
      color: var(--cyan);
    }

    .sel-section-label {
      font-size: .72rem;
      text-transform: uppercase;
      letter-spacing: .1em;
      color: var(--cyan);
      margin: 14px 0 6px;
      border-bottom: 1px solid rgba(255,255,255,.08);
      padding-bottom: 5px;
    }

    .sel-node-category {
      font-size: .8rem;
      color: var(--muted-foreground);
      text-transform: uppercase;
      letter-spacing: .1em;
      margin-bottom: 10px;
    }

    .sel-props-list {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .sel-props-list li {
      background: rgba(255,255,255,.04);
      border: 1px solid rgba(255,255,255,.1);
      border-radius: 6px;
      padding: 7px 11px;
      font-size: .85rem;
      line-height: 1.4;
      color: var(--muted-foreground);
      margin-bottom: 6px;
    }
    .sel-props-list li:last-child { margin-bottom: 0; }

    .sel-connections-list {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .sel-connections-list li {
      padding: .45rem 0;
      border-bottom: 1px solid var(--border);
      color: var(--muted-foreground);
      font-size: .88rem;
    }
    .sel-connections-list li:last-child { border-bottom: none; }

    .sel-empty {
      color: var(--muted-foreground);
      font-size: .88rem;
      line-height: 1.6;
    }

    /* ── Plein écran ── */
    body.page-graph { overflow: hidden; }

    #graph-topbar {
      position: fixed;
      top: 57px; /* hauteur du site-header */
      left: 0; right: 0;
      height: 44px;
      background: rgba(4,32,66,0.92);
      backdrop-filter: blur(8px);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 0 1.25rem;
      z-index: 40;
    }
    #graph-topbar-info {
      display: flex;
      align-items: center;
      gap: .8rem;
      flex: 0 1 auto;
      overflow: hidden;
      min-width: 0;
    }
    #graph-topbar-title {
      font-size: .9rem;
      font-weight: 600;
      color: #fff;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #graph-topbar-stats {
      font-size: .78rem;
      color: var(--muted-foreground);
      white-space: nowrap;
      flex-shrink: 0;
    }

    /* ── Recherche du graphe ── */
    #graph-search-wrap {
      position: relative;
      flex: 1;
      max-width: 320px;
      margin-left: auto;
    }
    #graph-search-icon {
      position: absolute;
      left: 11px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted-foreground);
      font-size: .82rem;
      pointer-events: none;
    }
    #graph-search {
      width: 100%;
      background: rgba(255,255,255,.05);
      border: 1px solid var(--border);
      border-radius: 20px;
      color: #fff;
      font-size: .82rem;
      font-family: inherit;
      padding: 6px 30px 6px 30px;
      outline: none;
      transition: border-color .15s, background .15s;
    }
    #graph-search::placeholder { color: var(--muted-foreground); }
    #graph-search:focus {
      border-color: var(--cyan);
      background: rgba(255,255,255,.08);
    }
    #graph-search-clear {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: var(--muted-foreground);
      font-size: .95rem;
      line-height: 1;
      cursor: pointer;
      padding: 3px 4px;
      display: none;
    }
    #graph-search-clear:hover { color: #fff; }
    #graph-search-wrap.has-value #graph-search-clear { display: block; }

    #graph-search-results {
      position: absolute;
      top: calc(100% + 6px);
      left: 0; right: 0;
      background: rgba(4,32,66,0.98);
      border: 1px solid var(--border);
      border-radius: 10px;
      max-height: 260px;
      overflow-y: auto;
      box-shadow: 0 10px 24px rgba(0,0,0,.4);
      display: none;
      z-index: 50;
    }
    #graph-search-wrap.show-results #graph-search-results { display: block; }
    .gs-result {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 8px 12px;
      font-size: .82rem;
      color: var(--foreground);
      cursor: pointer;
      border-bottom: 1px solid rgba(255,255,255,.06);
    }
    .gs-result:last-child { border-bottom: none; }
    .gs-result:hover, .gs-result.active { background: rgba(66,235,226,.1); }
    .gs-result-group {
      font-size: .68rem;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--cyan);
      flex-shrink: 0;
    }
    .gs-result-empty {
      padding: 10px 12px;
      font-size: .8rem;
      color: var(--muted-foreground);
    }
    .gs-match-count {
      font-size: .72rem;
      color: var(--cyan);
      white-space: nowrap;
      flex-shrink: 0;
      margin-left: .5rem;
    }
    @media (max-width: 768px) {
      #graph-topbar-info { display: none; }
      #graph-search-wrap { max-width: none; }
    }

    /* ── Import JSON (mode auteur uniquement) ── */
    #import-btn, #copy-data-btn {
      display: none; /* révélés uniquement en mode auteur (body.author-mode) */
      flex-shrink: 0;
      align-items: center;
      gap: 6px;
      background: rgba(66,235,226,.08);
      border: 1px solid rgba(66,235,226,.3);
      border-radius: 20px;
      color: var(--cyan);
      font-size: .78rem;
      font-family: inherit;
      padding: 5px 12px;
      cursor: pointer;
      white-space: nowrap;
      transition: background .15s, border-color .15s;
    }
    body.author-mode #import-btn { display: inline-flex; }
    body.author-mode.imported-graph #copy-data-btn { display: inline-flex; }
    #import-btn:hover, #copy-data-btn:hover {
      background: rgba(66,235,226,.16);
      border-color: var(--cyan);
    }

    #graph-dropzone {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      background: var(--background);
      z-index: 5;
    }
    #graph-dropzone[hidden] { display: none; }
    .dz-inner {
      max-width: 460px;
      text-align: center;
      border: 2px dashed rgba(66,235,226,.35);
      border-radius: 18px;
      padding: 3rem 2.2rem;
      transition: border-color .2s, background .2s;
    }
    #fullscreen-layout.drag-over .dz-inner {
      border-color: var(--cyan);
      background: rgba(66,235,226,.06);
    }
    .dz-icon { font-size: 2.2rem; color: var(--cyan); margin-bottom: .8rem; }
    .dz-inner h2 { font-size: 1.2rem; margin-bottom: .7rem; color: #fff; }
    .dz-inner p {
      font-size: .9rem;
      color: var(--muted-foreground);
      line-height: 1.6;
      margin-bottom: 1.1rem;
    }
    .dz-inner p b { color: var(--cyan); font-weight: 600; }
    .dz-hint {
      font-size: .78rem !important;
      margin-top: 1.1rem;
      margin-bottom: 0 !important;
    }
    #dropzone-pick {
      background: var(--cyan);
      color: #042042;
      border: none;
      border-radius: 22px;
      font-family: inherit;
      font-size: .88rem;
      font-weight: 600;
      padding: 9px 22px;
      cursor: pointer;
      transition: transform .15s, box-shadow .15s;
    }
    #dropzone-pick:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(66,235,226,.25);
    }

    /* Voile affiché lors d'un glisser-déposer par-dessus un graphe existant */
    #drag-overlay {
      display: none;
      position: absolute;
      inset: 0;
      z-index: 6;
      align-items: center;
      justify-content: center;
      background: rgba(4,7,13,.72);
      border: 2px dashed var(--cyan);
      color: var(--cyan);
      font-size: 1rem;
      font-weight: 600;
      pointer-events: none;
    }
    #fullscreen-layout.drag-over #drag-overlay { display: flex; }

    #import-toast {
      position: fixed;
      left: 50%;
      bottom: 26px;
      transform: translateX(-50%) translateY(12px);
      background: rgba(4,32,66,.97);
      border: 1px solid var(--border);
      border-left: 3px solid var(--cyan);
      border-radius: 10px;
      color: var(--foreground);
      font-size: .85rem;
      line-height: 1.5;
      padding: 10px 16px;
      max-width: min(520px, calc(100vw - 32px));
      box-shadow: 0 10px 30px rgba(0,0,0,.5);
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s ease, transform .2s ease;
      z-index: 90;
    }
    #import-toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
    #import-toast.error { border-left-color: #e05454; }

    @media (max-width: 768px) {
      #import-btn span.label, #copy-data-btn span.label { display: none; } /* icône seule sur mobile */
      #import-btn, #copy-data-btn { padding: 5px 10px; }
    }

    #fullscreen-layout {
      position: fixed;
      top: 101px; /* header 57px + topbar 44px */
      left: 0; right: 0; bottom: 0;
      display: flex;
    }
    #graph {
      flex: 1;
      height: 100%;
      background: var(--background);
    }
    #graph-sidebar {
      width: 300px;
      min-width: 300px;
      height: 100%;
      background: var(--surface);
      border-left: 1px solid var(--border);
      padding: 1.2rem;
      overflow-y: auto;
      font-size: .92rem;
    }
    #graph-sidebar h3 {
      font-size: 1rem;
      margin-bottom: .8rem;
      color: var(--cyan);
    }
    #graph-sidebar .stats {
      display: flex;
      gap: 1.5rem;
      margin-top: 1rem;
      color: var(--muted-foreground);
      font-size: .88rem;
    }
    #graph-sidebar .stats strong {
      color: var(--foreground);
      display: block;
      font-size: 1.4rem;
    }
    @media (max-width: 768px) {
      #graph-sidebar { width: 240px; min-width: 240px; }
    }

    /* ── Panneau latéral repliable (mobile) ── */
    #sidebar-close {
      display: none;
      background: none;
      border: none;
      color: var(--muted-foreground);
      font-size: 1.1rem;
      line-height: 1;
      cursor: pointer;
      padding: 4px 6px;
      margin: -4px -6px -4px 0;
    }
    #sidebar-close:hover { color: #fff; }
    #graph-sidebar-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    #sidebar-toggle-fab {
      display: none;
      position: fixed;
      right: 16px;
      bottom: 20px;
      z-index: 46;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: var(--cyan);
      color: #042042;
      border: none;
      font-size: 1.2rem;
      align-items: center;
      justify-content: center;
      box-shadow: 0 6px 18px rgba(0,0,0,.45);
      cursor: pointer;
    }

    #sidebar-backdrop {
      display: none;
      position: fixed;
      top: 101px; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,.45);
      z-index: 44;
      opacity: 0;
      transition: opacity .2s ease;
    }

    @media (max-width: 768px) {
      #sidebar-toggle-fab { display: flex; }
      #sidebar-close { display: block; }

      #graph-sidebar {
        position: fixed;
        top: 101px;
        right: 0;
        bottom: 0;
        width: 84vw;
        max-width: 320px;
        min-width: 0;
        z-index: 45;
        transform: translateX(100%);
        transition: transform .25s ease;
        box-shadow: -10px 0 30px rgba(0,0,0,.5);
      }
      #fullscreen-layout.sidebar-open #graph-sidebar {
        transform: translateX(0);
      }
      #fullscreen-layout.sidebar-open #sidebar-backdrop {
        display: block;
        opacity: 1;
      }
      #fullscreen-layout.sidebar-open #sidebar-toggle-fab {
        background: rgba(255,255,255,.12);
        color: #fff;
      }
      #graph { width: 100%; }
    }
  

/* ═══════════════════════════════════════════════════════════════════════════
   Page graphe — outils, légende et vue tableau (parité avec l'export HTML
   du WynaGraph Workspace)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Boutons d'outils de la topbar ── */
#graph-tools {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
}
#graph-tools button {
  background: #1D3655;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: .78rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
#graph-tools button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
#graph-tools button.active {
  background: #0f1f33;
  color: var(--cyan);
  border-color: var(--cyan);
}

/* ── Légende des catégories ── */
#graph-legend {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 32px));
  background: rgba(15, 31, 51, 0.96);
  border: 1px solid rgba(66, 235, 226, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
#graph-legend .legend-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-foreground);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}
#graph-legend .legend-title:hover { color: var(--cyan); }
#graph-legend.collapsed .legend-title { margin-bottom: 0; }
#graph-legend.collapsed #graph-legend-chips { display: none; }
#graph-legend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#graph-legend-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(4, 32, 66, 0.85);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, box-shadow .15s;
}
#graph-legend-chips.has-filter .chip:not(.chip-active) { opacity: .35; }
#graph-legend-chips .chip-active { box-shadow: 0 0 0 2px var(--cyan); }
#graph-legend-chips .chip-hidden { opacity: .3; }
#graph-legend-chips .chip-hidden .chip-label { text-decoration: line-through; }
.chip-eye {
  font-size: 11px;
  line-height: 1;
  opacity: .7;
}
.chip-eye:hover { opacity: 1; }

/* ── Vue tableau (lecture seule) ── */
#graph-table-wrap {
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  right: calc(300px + 16px); /* laisse la sidebar (300px) visible */
  z-index: 25;
  overflow: auto;
  background: rgba(15, 31, 51, 0.96);
  border: 1px solid rgba(66, 235, 226, 0.25);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#graph-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#graph-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0c1a2c;
  color: var(--muted-foreground);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(66, 235, 226, 0.2);
  white-space: nowrap;
}
#graph-table-wrap thead th:hover { color: var(--cyan); }
#graph-table-wrap thead th .sort-ind { margin-left: 6px; color: var(--cyan); }
#graph-table-wrap thead th .sort-ind.idle { opacity: .25; }
#graph-table-wrap tbody td {
  padding: 9px 14px;
  vertical-align: top;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
#graph-table-wrap tbody tr { cursor: pointer; }
#graph-table-wrap tbody tr:hover td { background: rgba(66, 235, 226, 0.06); }
#graph-table-wrap .cell-main {
  color: #fff;
  font-weight: 600;
  word-break: break-word;
}
#graph-table-wrap .cell-props {
  color: var(--muted-foreground);
  font-size: 12px;
  margin-top: 3px;
  word-break: break-word;
}
#graph-table-wrap .table-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted-foreground);
  font-style: italic;
}

/* ── Responsive : la topbar peut passer sur deux lignes avec les outils ── */
@media (max-width: 900px) {
  /* La topbar garde sa hauteur fixe (44px, cf. #fullscreen-layout) :
     seule la barre d'outils défile horizontalement si la place manque,
     pour ne pas rogner la liste déroulante des résultats de recherche. */
  #graph-search-wrap { min-width: 130px; }
  #graph-tools {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 52vw;
    scrollbar-width: none;
  }
  #graph-tools::-webkit-scrollbar { display: none; }
  #graph-tools button { font-size: .72rem; padding: 4px 9px; }
  #graph-legend { bottom: 12px; left: 12px; }
}
@media (max-width: 768px) {
  /* La sidebar est hors-écran : le tableau occupe toute la largeur */
  #graph-table-wrap { top: 12px; left: 12px; right: 12px; bottom: 12px; }
}
