/* ============================================================
   Sirenne — feuille de style
   Système extrait de la maquette : bleu registre #0B3A8F,
   encre neutre, IBM Plex Serif / Sans / Mono.
   ============================================================ */

:root {
  --blue: #0b3a8f;
  --blue-ink: #08306b;
  --blue-mid: #1150b8;
  --blue-dark: #082a66;
  --ink: #16181d;
  --gray: #5b6472;
  --muted: #8a93a2;
  --faint: #a0a8b4;
  --green: #0f7a4d;
  --green-bg: #e6f4ec;
  --mint: #7fe3ac;
  --amber: #b25e09;
  --amber-bg: #fbf0df;
  --red: #b42318;
  --red-bg: #fbe9e7;
  --line: #e1e5ea;
  --line-soft: #eceef1;
  --line-faint: #f1f3f6;
  --surface: #fafbfc;
  --surface-2: #f7f9fc;
  --tint: #eef3fb;
  --shadow: 0 18px 50px -20px rgba(16, 24, 40, .22);
  --serif: 'IBM Plex Serif', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --wrap: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }

/* --- Header / nav ------------------------------------------ */
.site-header {
  display: flex; align-items: center; gap: 28px;
  padding: 0 clamp(16px, 4vw, 40px); height: 64px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-name {
  font: 700 20px var(--serif); letter-spacing: -.02em; color: var(--ink);
}
.logo {
  position: relative; width: 30px; height: 30px; border-radius: 8px;
  overflow: hidden; display: flex; flex: none;
}
.logo::before { content: ""; flex: 1; background: var(--blue-ink); }
.logo::after { content: ""; flex: 1; background: var(--blue-mid); }
.logo span {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font: 700 18px var(--serif); color: #fff;
  margin-top: -1px;
}
.logo.lg { width: 62px; height: 62px; border-radius: 15px; }
.logo.lg span { font-size: 38px; }

.main-nav { display: flex; gap: 22px; font: 500 14px var(--sans); }
.main-nav a { color: var(--gray); }
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { color: var(--blue); font-weight: 600; }
.spacer { flex: 1; }

.btn {
  border: 0; background: var(--blue); color: #fff;
  font: 600 14px var(--sans); padding: 10px 17px; border-radius: 9px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn.ghost {
  background: #fff; color: var(--blue); border: 1px solid #d7deea;
}
.btn.ghost:hover { background: var(--tint); }
.btn.sm { padding: 8px 13px; font-size: 13px; }
.link-quiet { font: 500 14px var(--sans); color: var(--gray); }
.link-quiet:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 16px; }

/* Burger (mobile) */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0 9px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; cursor: pointer; flex: none;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; background: var(--ink);
  border-radius: 2px; transition: transform .2s, opacity .2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Panneau menu mobile */
.mobile-menu {
  display: none; flex-direction: column; gap: 4px; padding: 12px 16px 18px;
  border-bottom: 1px solid var(--line-soft); background: #fff;
  position: sticky; top: 64px; z-index: 19;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 12px 12px; border-radius: 9px; font: 500 15px var(--sans);
  color: var(--ink);
}
.mobile-menu a:hover, .mobile-menu a.active { background: var(--tint); color: var(--blue); }
.mobile-menu a.btn { color: #fff; }
.mobile-menu-sep { height: 1px; background: var(--line-soft); margin: 6px 0; }

/* --- Layout ------------------------------------------------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

.site-footer {
  border-top: 1px solid var(--line-soft); margin-top: 64px;
  padding: 30px 0; color: var(--gray);
  font: 400 12.5px var(--mono); text-align: center;
}
.site-footer a { color: var(--gray); }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-bottom: 14px; }
.footer-nav a { font: 500 13px var(--sans); color: var(--gray); }
.footer-nav a:hover { color: var(--blue); }
.footer-src { font: 400 12.5px var(--mono); color: var(--gray); }
/* Accessibilité : liens en ligne identifiables autrement que par la couleur */
.footer-src a, .home-about a, .page p a, .crumbs a, .fine a { text-decoration: underline; }

/* Pages de contenu (À propos, légal, confidentialité) */
.page { max-width: 760px; padding-bottom: 40px; }
.page-head { padding: clamp(30px, 5vw, 52px) 0 6px; }
.page-head h1 { margin: 0 0 12px; font: 600 clamp(26px, 4vw, 34px)/1.15 var(--serif); letter-spacing: -.01em; }
.page-head .lead { margin: 0; font: 400 16px/1.6 var(--sans); color: var(--gray); }
.page h2 { margin: 30px 0 10px; font: 600 19px var(--serif); }
.page p { font: 400 14.5px/1.7 var(--sans); color: #3a4150; margin: 0 0 12px; }
.page .src-list { list-style: none; padding: 0; margin: 6px 0 12px; display: flex; flex-direction: column; gap: 12px; }
.page .src-list li { font: 400 14px/1.6 var(--sans); color: #3a4150; padding-left: 16px; border-left: 3px solid var(--tint); }
.muted-note { color: var(--muted); font-style: italic; }
.page-src { margin-top: 26px; font: 400 12.5px var(--mono); color: var(--faint); }

/* Accueil : contenu SEO + FAQ */
.home-about { max-width: 760px; margin: 44px auto 0; }
.home-about h2 { font: 600 22px var(--serif); margin: 0 0 14px; letter-spacing: -.01em; }
.home-about p { font: 400 15px/1.7 var(--sans); color: var(--gray); margin: 0 0 14px; }
.home-faq { max-width: 820px; margin: 44px auto 10px; }
.home-faq h2 { font: 600 22px var(--serif); margin: 0 0 18px; text-align: center; }
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.faq-item { background: #fff; border: 1px solid #e6e9ee; border-radius: 12px; padding: 18px 20px; }
.faq-item h3 { margin: 0 0 6px; font: 600 15px var(--sans); }
.faq-item p { margin: 0; font: 400 13.5px/1.55 var(--sans); color: var(--gray); }
@media (max-width: 640px) { .faq { grid-template-columns: 1fr; } }

/* --- Hero / accueil ---------------------------------------- */
.hero { padding: clamp(44px, 8vw, 76px) 0 8px; text-align: center; }
.eyebrow {
  font: 500 11.5px var(--mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 16px;
}
.hero h1 {
  margin: 0 auto 16px; max-width: 640px;
  font: 600 clamp(28px, 4.4vw, 38px)/1.14 var(--serif); letter-spacing: -.015em;
}
.hero .lede {
  margin: 0 auto 30px; max-width: 560px;
  font: 400 16px/1.6 var(--sans); color: var(--gray);
}

.search-tabs { display: flex; justify-content: center; margin-bottom: -1px; }
.search-tabs span {
  padding: 9px 15px; font: 500 13px var(--sans); color: var(--muted);
  cursor: default;
}
.search-tabs span.on {
  color: var(--blue); font-weight: 600; background: #fff;
  border: 1px solid #d7deea; border-bottom-color: #fff;
  border-radius: 9px 9px 0 0;
}
.search-bar {
  display: flex; align-items: center; gap: 10px; max-width: 640px;
  margin: 0 auto; padding: 7px 7px 7px 16px; background: #fff;
  border: 1px solid #d7deea; border-radius: 0 10px 10px 10px;
}
.search-bar svg { flex: none; }
.search-bar input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: 400 16px var(--sans); color: var(--ink);
}
.chips {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 16px; margin-top: 16px;
  font: 400 13px var(--sans); color: var(--faint);
}
.chips a { font-weight: 500; }

.hero-stats {
  display: flex; justify-content: center; gap: clamp(28px, 6vw, 64px);
  margin: 48px 0 0; padding: 28px 0 44px;
  border-top: 1px solid var(--line-soft); text-align: center;
}
.hero-stats .value { font: 600 28px var(--serif); color: var(--ink); }
.hero-stats .label { font: 400 12.5px var(--sans); color: var(--gray); margin-top: 3px; }

.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; padding: 40px 0 8px;
}
.feature {
  background: #fff; border: 1px solid #e6e9ee; border-radius: 12px; padding: 22px;
}
.feature .ico {
  width: 38px; height: 38px; border-radius: 9px; background: var(--tint);
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  font: 600 18px var(--serif); margin-bottom: 14px;
}
.feature h2 { margin: 0 0 6px; font: 600 16px var(--sans); }
.feature p { margin: 0; font: 400 13.5px/1.55 var(--sans); color: var(--gray); }

/* --- Badges ------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font: 600 11.5px var(--sans);
  white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--green); background: var(--green-bg); }
.badge.danger { color: var(--red); background: var(--red-bg); }
.badge.warn { color: var(--amber); background: var(--amber-bg); }
.badge.info { color: var(--blue); background: var(--tint); }
.badge.muted { color: var(--gray); background: var(--line-faint); }

/* --- Résultats de recherche -------------------------------- */
.results-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 26px 0 18px;
}
.results-head .count { font: 400 14px var(--sans); color: var(--gray); }
.results-head .count b { color: var(--ink); font-weight: 600; }

.search-layout { display: grid; grid-template-columns: 244px 1fr; gap: 26px; align-items: start; }
.filters {
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 20px; background: var(--surface); position: sticky; top: 84px;
}
.filters h4 {
  margin: 0 0 12px; font: 600 12px var(--sans); text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.filter-group { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.filter-group:last-child { border: 0; margin: 0; padding: 0; }
.filter-opt {
  display: flex; align-items: center; gap: 9px; padding: 5px 0;
  font: 400 13.5px var(--sans); color: var(--gray); cursor: pointer;
}
.filter-opt input { accent-color: var(--blue); flex: none; }
.filter-opt.on { color: var(--ink); font-weight: 500; }
.filter-title { font: 600 12px var(--sans); color: var(--muted); margin-bottom: 8px; }
.filter-lbl {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filter-count { font: 400 12px var(--mono); color: var(--faint); flex: none; }

/* --- Autocomplétion ---------------------------------------- */
.search-wrap { position: relative; max-width: 640px; margin: 0 auto; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: #fff; border: 1px solid #d7deea; border-radius: 10px;
  box-shadow: 0 18px 44px -16px rgba(16, 24, 40, .28); overflow: hidden;
  display: none;
}
.suggest.open { display: block; }
.suggest-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  cursor: pointer; border-bottom: 1px solid var(--line-faint); text-align: left;
}
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item.active { background: var(--tint); }
.suggest-item .sg-av {
  width: 30px; height: 30px; border-radius: 7px; background: #f2f5f9;
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  font: 600 12px var(--serif); flex: none;
}
.suggest-item .sg-main { flex: 1; min-width: 0; }
.suggest-item .sg-name {
  display: block; font: 600 13.5px var(--sans); color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.suggest-item .sg-act {
  display: block; font: 400 12px var(--sans); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.suggest-item .sg-act:empty { display: none; }
.suggest-item .sg-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.suggest-item .sg-dot.on { background: var(--green); }
.suggest-item .sg-dot.off { background: var(--faint); }

.result-list { display: flex; flex-direction: column; gap: 12px; }
.result-card {
  display: flex; align-items: flex-start; gap: 14px;
  border: 1px solid #e6e9ee; border-radius: 12px; padding: 18px 20px;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.result-card:hover { border-color: #cdd8ea; box-shadow: 0 8px 24px -16px rgba(16,24,40,.3); }
.avatar {
  width: 44px; height: 44px; border-radius: 9px; background: #f2f5f9;
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  font: 600 15px var(--serif); flex: none;
}
.avatar.pm { background: var(--tint); }
.result-main { flex: 1; min-width: 0; }
.result-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-title a { font: 600 16px var(--sans); }
.result-sub { font: 400 13px var(--sans); color: var(--muted); margin: 4px 0 12px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font: 400 12.5px var(--sans); color: var(--gray); }
.result-meta b { color: var(--ink); font-weight: 500; }
.result-meta .mono { color: var(--ink); font-weight: 500; }
.result-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.result-aside .date { font: 400 11.5px var(--mono); color: var(--faint); }

.pagination { display: flex; justify-content: center; gap: 6px; margin: 28px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--line); color: #40474f;
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 13px var(--sans);
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .on { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination .gap { border: 0; }

/* --- Fiche entreprise -------------------------------------- */
.crumbs { font: 400 12.5px var(--sans); color: var(--muted); margin: 20px 0 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--gray); }

.profile-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.profile-avatar {
  position: relative; width: 62px; height: 62px; border-radius: 13px;
  background: var(--blue); color: #fff; display: flex; align-items: center;
  justify-content: center; font: 600 24px var(--serif); flex: none; overflow: hidden;
}
/* Logo (favicon) qui recouvre les initiales dans n'importe quel avatar */
.avatar, .cav, .round { position: relative; overflow: hidden; }
.logo-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  background: #fff; padding: 6px;
}
.profile-avatar .logo-img, .round .logo-img { padding: 5px; }
.sg-av { position: relative; overflow: hidden; }
.sg-av .logo-img { padding: 3px; }
.profile-id { flex: 1; min-width: 240px; }
.profile-id h1 { margin: 0; font: 600 27px var(--serif); letter-spacing: -.01em; display: inline; }
.profile-line {
  display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px;
  font: 400 13.5px var(--sans); color: var(--gray);
}
.profile-line b { color: var(--ink); font-weight: 500; }
.profile-actions { display: flex; gap: 9px; flex: none; }
.label-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

.tabs { display: flex; gap: 24px; margin-top: 22px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.tabs a {
  padding: 0 0 13px; font: 500 14px var(--sans); color: var(--gray);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a.on { color: var(--blue); border-bottom-color: var(--blue); }

.fiche-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; margin: 24px 0 0; align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.card { overflow-wrap: anywhere; }

.card {
  background: #fff; border: 1px solid #e6e9ee; border-radius: 12px; padding: 22px 24px;
}
.card > h2 {
  margin: 0 0 16px; font: 600 15px var(--sans);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card > h2 .note { font: 400 12px var(--mono); color: var(--faint); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; }
.kv .k { font: 400 12px var(--sans); color: var(--muted); margin-bottom: 3px; }
.k.def { display: inline-block; cursor: help;
  text-decoration: underline dotted var(--line); text-underline-offset: 3px; }
.badge[title] { cursor: help; }
.kv .v { font: 500 14px var(--sans); color: var(--ink); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 15px;
}
.stat .k { font: 400 12px var(--sans); color: var(--muted); }
.stat .v { font: 600 24px var(--serif); margin: 5px 0 2px; }
.stat .d { font: 500 12.5px var(--sans); color: var(--gray); }
.stat .d.up { color: var(--green); }

/* @@CRITICAL_END@@ — tout ce qui précède est inliné dans le <head> (above-the-fold) ;
   le reste est chargé de façon asynchrone (voir base.html + app.py). */

.row-list { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 13px; padding: 11px 0;
  border-bottom: 1px solid var(--line-faint);
}
.row-item:last-child { border: 0; }
.row-item .who { flex: 1; min-width: 0; }
.row-item .who .n { font: 600 14px var(--sans); }
.row-item .who .r { font: 400 12.5px var(--sans); color: var(--muted); }
.round {
  width: 38px; height: 38px; border-radius: 50%; background: var(--tint);
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  font: 600 13px var(--sans); flex: none;
}

.sim-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.sim-list li { break-inside: avoid; padding: 5px 0; font: 400 13.5px var(--sans); }
.sim-list a { color: var(--blue); }
@media (max-width: 560px) { .sim-list { columns: 1; } }

.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.doc {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #e6e9ee; border-radius: 10px; background: #fff;
}
.doc:hover { border-color: #cdd8ea; }
.doc .ext {
  width: 34px; height: 34px; border-radius: 7px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font: 600 10px var(--mono);
}
.doc .ext.pdf { background: var(--red-bg); color: var(--red); }
.doc .ext.xls { background: var(--green-bg); color: var(--green); }
.doc .name { font: 500 13.5px var(--sans); color: var(--ink); }
.doc .meta { font: 400 12px var(--sans); color: var(--muted); }

/* score / sidebar */
.score { background: var(--blue); color: #fff; border-radius: 12px; padding: 22px 24px; }
.score .lbl { font: 400 12.5px var(--sans); color: #b9cbeb; }
.score .grade { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 12px; }
.score .grade b { font: 600 42px var(--serif); }
.score .grade span { font: 400 14px var(--sans); color: #b9cbeb; }
.score .bar { height: 7px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; }
.score .bar > i { display: block; height: 100%; background: var(--mint); transition: width .4s; }
.score.g-c .bar > i { background: #f0b429; }
.score.g-d .bar > i { background: #f3766a; }
.score.g-c .grade b { color: #ffd873; }
.score.g-d .grade b { color: #ffb3aa; }
.score .foot { font: 400 12px/1.5 var(--sans); color: #c9d6ee; margin-top: 12px; }
.score-fac { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.score-fac span {
  font: 500 11px var(--sans); color: #dbe6fb; background: rgba(255,255,255,.12);
  padding: 3px 9px; border-radius: 999px;
}

.map-stub {
  height: 130px; display: flex; align-items: center; justify-content: center;
  background-image: repeating-linear-gradient(45deg, #eef1f5 0 12px, #e4e8ee 12px 24px);
}
.map-stub span {
  font: 500 12px var(--mono); color: #9aa4b2; background: #fff;
  padding: 5px 11px; border-radius: 6px; border: 1px solid var(--line);
}
.addr { font: 400 13.5px/1.6 var(--sans); color: #40474f; }
.site-link { display: inline-flex; align-items: center; gap: 7px; font: 500 13.5px var(--sans); }
.site-link svg { flex: none; }
.hr { height: 1px; background: var(--line-soft); margin: 14px 0; }

/* Graphe des comptes annuels */
.bars { display: flex; align-items: flex-end; gap: 14px; padding: 4px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar-track { height: 120px; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.bar {
  width: 100%; background: linear-gradient(180deg, var(--blue-mid), var(--blue));
  border-radius: 5px 5px 0 0; min-height: 3px;
}
.bar-lbl { font: 400 12px var(--mono); color: var(--faint); }
.bar-lbl.on { color: var(--ink); font-weight: 500; }
.fine { font: 400 11.5px/1.5 var(--sans); color: var(--faint); margin: 16px 0 0; }

/* Timeline BODACC */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 13px; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: none; background: var(--blue); position: relative; }
.tl-dot.ok { background: var(--green); }
.tl-dot.danger { background: var(--red); }
.tl-dot.warn { background: var(--amber); }
.tl-dot.info { background: var(--blue); }
.tl-item:not(:last-child) .tl-dot::after {
  content: ""; position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  width: 2px; height: calc(100% + 16px); background: var(--line-soft);
}
.tl-body { flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tl-head b { font: 600 14px var(--sans); color: var(--ink); }
.tl-date { font-size: 12px; color: var(--faint); flex: none; }
.tl-detail { font: 400 13px/1.5 var(--sans); color: var(--gray); margin-top: 2px; }
.tl-meta { font: 400 12px var(--sans); color: var(--faint); margin-top: 3px; }

/* --- Comparateur ------------------------------------------- */
.compare-table { width: 100%; border-collapse: collapse; background: #fff; }
.compare-table th, .compare-table td {
  border-top: 1px solid var(--line-faint); padding: 13px 16px;
  font: 500 13.5px var(--sans); text-align: center; vertical-align: middle;
}
.compare-table td.rowlabel {
  text-align: left; font: 400 13px var(--sans); color: var(--muted);
  border-left: 0; width: 180px;
}
.compare-table td { border-left: 1px solid var(--line-faint); }
.compare-table thead th {
  border-top: 0; border-left: 1px solid var(--line-faint); padding: 16px 14px;
}
.compare-table thead th:first-child { border-left: 0; }
.compare-table .cav {
  width: 40px; height: 40px; border-radius: 9px; background: var(--tint);
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  font: 600 15px var(--serif); margin: 0 auto 9px;
}
.compare-table .cname { font: 600 14px var(--sans); color: var(--blue); }
.compare-table .csiren { font: 400 11.5px var(--mono); color: var(--faint); margin-top: 3px; }
.cell-ok { color: var(--green); }
.cell-danger { color: var(--red); }

/* Gestion du comparateur (panier persistant) */
.cmp-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid #d7deea;
  background: #fff; color: var(--blue); font: 600 13.5px var(--sans);
  padding: 9px 14px; border-radius: 9px; cursor: pointer; width: 100%;
  justify-content: center;
}
.cmp-btn:hover { background: var(--tint); }
.cmp-btn.in { background: var(--green-bg); border-color: #cce9d9; color: var(--green); }
.cmp-manage { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-chip {
  display: inline-flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 14px;
  font: 500 13px var(--sans);
}
.cmp-chip a { color: var(--ink); }
.cmp-chip button {
  border: 0; background: var(--line-faint); color: var(--gray); width: 20px; height: 20px;
  border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; display: flex;
  align-items: center; justify-content: center;
}
.cmp-chip button:hover { background: var(--red-bg); color: var(--red); }
.cmp-empty { color: var(--gray); font: 400 14px var(--sans); margin: 0; }
.cmp-hint { font: 400 13px var(--sans); color: var(--muted); }
.cmp-add { max-width: 520px; }
.cmp-col-x {
  position: absolute; top: 8px; right: 8px; border: 0; background: rgba(0,0,0,.05);
  color: var(--gray); width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  font-size: 15px; line-height: 1;
}
.cmp-col-x:hover { background: var(--red-bg); color: var(--red); }
.compare-table thead th { position: relative; }
.cmp-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px;
  font: 500 13.5px var(--sans); opacity: 0; transition: all .25s; z-index: 100;
}
.cmp-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* pastille de compteur dans la nav */
[data-compare-count]:not(:empty) { color: var(--blue); font-weight: 700; }

/* Bouton comparateur compact (résultats de recherche) */
.result-actions { display: flex; align-items: center; gap: 8px; }
.cmp-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none; border: 1px solid #d7deea; background: #fff;
  color: var(--gray); border-radius: 8px; cursor: pointer;
}
.cmp-mini:hover { border-color: var(--blue); color: var(--blue); background: var(--tint); }
.cmp-mini.in { background: var(--green-bg); border-color: #cce9d9; color: var(--green); }
.cmp-mini.in::after { content: "✓"; font: 700 11px var(--sans); margin-left: -3px; }

/* Barre d'actions contextuelle (page dirigeant) */
.dir-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 18px; }

/* Options avancées de recherche (accueil) */
.adv-search { max-width: 540px; margin: 12px auto 0; text-align: left; }
.adv-search summary {
  cursor: pointer; font: 500 13.5px var(--sans); color: var(--blue);
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.adv-search summary::-webkit-details-marker { display: none; }
.adv-search summary::before { content: "⚙"; }
.adv-search-body {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px;
  margin-top: 12px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: 12px;
}
.adv-check { display: inline-flex; align-items: center; gap: 8px; font: 500 13.5px var(--sans); color: var(--ink); cursor: pointer; }
.adv-check input { width: 16px; height: 16px; accent-color: var(--blue); }
.adv-field { display: inline-flex; align-items: center; gap: 8px; font: 500 13.5px var(--sans); color: var(--gray); }
.adv-field select, .filter-select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: 400 13.5px var(--sans); color: var(--ink); background: #fff; cursor: pointer;
}
.filter-select { width: 100%; }

/* Formulaire de contact */
.contact-form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.contact-form .field { display: flex; flex-direction: column; gap: 6px; }
.contact-form .field > span { font: 600 13px var(--sans); color: var(--ink); }
.contact-form .field > span em { color: var(--red); font-style: normal; }
.contact-form .field-row { display: flex; gap: 16px; }
.contact-form .field-row .field { flex: 1; }
.contact-form input, .contact-form textarea {
  font: 400 15px var(--sans); color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--tint);
}
.contact-form textarea { resize: vertical; min-height: 130px; line-height: 1.55; }
.contact-form .form-actions { margin-top: 4px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 560px) { .contact-form .field-row { flex-direction: column; gap: 16px; } }

/* --- Utilitaires / états ----------------------------------- */
.section-block { background: var(--surface); }
.empty {
  text-align: center; padding: 60px 20px; color: var(--gray);
}
.empty h2 { font: 600 20px var(--serif); color: var(--ink); margin: 0 0 8px; }
.notice {
  background: var(--tint); border: 1px solid #d7e2f4; border-radius: 10px;
  padding: 12px 16px; font: 400 13px var(--sans); color: var(--gray);
  margin-bottom: 16px;
}

/* --- Page Données ouvertes --------------------------------- */
.od { padding-bottom: 20px; }
.od-hero { padding: clamp(36px, 6vw, 64px) 0 8px; max-width: 760px; }
.od-hero h1 { margin: 0 0 14px; font: 600 clamp(28px, 4.6vw, 40px)/1.12 var(--serif); letter-spacing: -.02em; }
.od-hero .lede { margin: 0; font: 400 16px/1.6 var(--sans); color: var(--gray); }

.od-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 28px 0 8px; }
.od-tile { background: #fff; border: 1px solid #e6e9ee; border-radius: 14px; padding: 20px 22px; }
.od-tile .t-val { font: 600 34px var(--serif); color: var(--ink); letter-spacing: -.01em; }
.od-tile .t-key { font: 400 13px var(--sans); color: var(--gray); margin-top: 4px; }
.od-tile .t-sub { font: 400 12px var(--mono); color: var(--faint); margin-top: 8px; }
.od-tile.accent { background: var(--blue); border-color: var(--blue); }
.od-tile.accent .t-val { color: #fff; }
.od-tile.accent .t-key { color: #c9d6ee; }

.od-block { background: #fff; border: 1px solid #e6e9ee; border-radius: 16px; padding: 26px 28px; margin-top: 22px; }
.od-block h2 { margin: 0 0 4px; font: 600 20px var(--serif); letter-spacing: -.01em; }
.od-block h3 { margin: 0 0 14px; font: 600 15px var(--sans); }
.od-sub { margin: 0 0 18px; font: 400 13.5px var(--sans); color: var(--muted); }
.od-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.od-block-head h2 { margin: 0 0 2px; }

.od-period { display: flex; flex-direction: column; gap: 5px; }
.od-period label { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.od-period select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font: 500 14px var(--sans); background: #fff; color: var(--ink); cursor: pointer; }

/* Série temporelle (créations par année) — teinte unique */
.ts-chart { display: flex; align-items: flex-end; gap: 3px; height: 220px; padding-top: 10px; }
.ts-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.ts-bar { width: 100%; background: var(--blue-mid); border-radius: 4px 4px 0 0; min-height: 2px; transition: background .15s; }
.ts-col:hover .ts-bar { background: var(--blue-ink); }
.ts-col.on .ts-bar { background: var(--blue); }
.ts-yr { font: 400 10px var(--mono); color: var(--faint); text-align: center; margin-top: 6px; height: 12px; white-space: nowrap; }

/* Barres horizontales de magnitude */
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr auto; align-items: center; gap: 12px; }
.hbar-label { font: 400 13px var(--sans); color: var(--gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--blue); border-radius: 999px; min-width: 3px; }
.hbar-val { font: 500 13px var(--mono); color: var(--ink); text-align: right; min-width: 46px; }

/* Détail année */
.od-year { display: grid; grid-template-columns: 260px 1fr; gap: 22px; margin-top: 22px; align-items: stretch; }
.od-year-kpi { background: var(--blue); color: #fff; border-radius: 16px; padding: 26px; display: flex; flex-direction: column; justify-content: center; }
.od-year-kpi .eyebrow { color: #b9cbeb; text-align: left; margin-bottom: 8px; }
.od-year-kpi .oy-val { font: 600 42px var(--serif); letter-spacing: -.01em; }
.od-year-kpi .oy-key { font: 400 13.5px var(--sans); color: #c9d6ee; margin-top: 2px; }
.od-year-kpi .oy-delta { margin-top: 14px; display: inline-block; align-self: flex-start; padding: 5px 11px; border-radius: 999px; font: 600 13px var(--sans); background: rgba(255,255,255,.14); }
.od-year-kpi .oy-delta.up { color: #7fe3ac; }
.od-year-kpi .oy-delta.down { color: #f3b0a6; }
.od-year-sec { background: #fff; border: 1px solid #e6e9ee; border-radius: 16px; padding: 24px 26px; }

.od-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.od-grid2 .od-block { margin-top: 0; }

.od-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.split-head { display: flex; justify-content: space-between; font: 500 13.5px var(--sans); color: var(--ink); }
.split-head span:last-child { font-family: var(--mono); color: var(--gray); }
.split-bar { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 8px 0; border: 1px solid var(--line-soft); }
.split-a { height: 100%; background: var(--blue); }

.od-details summary { cursor: pointer; font: 600 14px var(--sans); color: var(--blue); }
.od-table { width: 100%; border-collapse: collapse; }
.od-table th, .od-table td { text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--line-faint); font: 400 13px var(--sans); }
.od-table th { font: 600 12px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.od-table td:last-child { font-family: var(--mono); }

.od-method { margin-top: 22px; padding: 4px 2px 0; max-width: 760px; }
.od-method h2 { font: 600 18px var(--serif); margin: 0 0 10px; }
.od-method p { font: 400 14.5px/1.7 var(--sans); color: var(--gray); margin: 0 0 12px; }
.od-src { font: 400 12.5px var(--mono) !important; color: var(--faint) !important; }

@media (max-width: 820px) {
  .od-grid2 { grid-template-columns: 1fr; }
  .od-year { grid-template-columns: 1fr; }
  .ts-chart { height: 170px; }
  .hbar-row { grid-template-columns: minmax(90px, 130px) 1fr auto; gap: 8px; }
}

/* --- Galaxie (réseau dirigeants / entreprises) ------------- */
.gx-head { padding: clamp(32px, 5vw, 56px) 0 4px; max-width: 760px; margin: 0 auto; text-align: center; }
.gx-head h1 { margin: 0 0 12px; font: 600 clamp(26px, 4vw, 36px)/1.14 var(--serif); letter-spacing: -.02em; }
.gx-head .lede { margin: 0 auto 22px; max-width: 620px; font: 400 15.5px/1.6 var(--sans); color: var(--gray); }

.gx-controls { display: flex; align-items: flex-end; justify-content: center; gap: 18px; flex-wrap: wrap; max-width: 720px; margin: 0 auto; }
.gx-search { flex: 1; min-width: 240px; margin: 0; }
.gx-sauts { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.gx-sauts label { font: 500 13px var(--sans); color: var(--ink); }
.gx-sauts label b { color: var(--blue); font-family: var(--mono); }
.gx-sauts input[type=range] { accent-color: var(--blue); width: 100%; }
.gx-hint { font: 400 11.5px var(--sans); color: var(--muted); }

.gx-stage {
  position: relative; margin-top: 22px; border-radius: 16px; overflow: hidden;
  border: 1px solid #1c2436; background: #0a0e18;
  height: clamp(420px, 68vh, 720px);
}
.gx-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
/* Vue plein écran */
.gx-stage:fullscreen, .gx-stage:-webkit-full-screen {
  width: 100vw; height: 100vh; margin: 0; border: 0; border-radius: 0;
}
.gx-stage:fullscreen canvas { cursor: grab; }

/* Paramètres avancés (galaxie) */
.gx-advanced { flex-basis: 100%; width: 100%; max-width: 460px; margin: 4px auto 0; text-align: left; }
.gx-advanced summary {
  cursor: pointer; font: 500 13px var(--sans); color: var(--blue);
  list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0;
}
.gx-advanced summary::-webkit-details-marker { display: none; }
.gx-advanced summary::before { content: "⚙"; font-size: 13px; }
.gx-advanced[open] summary { margin-bottom: 8px; }
.gx-adv-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 10px; }
.gx-adv-body label { font: 600 12.5px var(--sans); color: var(--ink); }
.gx-adv-body select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: 400 13.5px var(--sans); color: var(--ink); background: #fff; max-width: 240px;
}
.gx-adv-check { display: inline-flex; align-items: flex-start; gap: 8px; margin-top: 6px;
  font: 500 13px var(--sans); color: var(--ink); cursor: pointer; }
.gx-adv-check input { width: 16px; height: 16px; accent-color: var(--blue); margin-top: 1px; flex: none; }

/* Recherche dans le réseau affiché (galaxie) */
.gx-find {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 4;
  width: min(320px, 62%); display: flex; align-items: center; gap: 8px;
  background: rgba(16,22,38,.85); border: 1px solid #2a3550; border-radius: 10px;
  padding: 7px 12px; backdrop-filter: blur(6px);
}
.gx-find input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: #e6ecf8;
  font: 400 13px var(--sans); outline: none;
}
.gx-find input::placeholder { color: #7f8bab; }
.gx-find-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; display: none;
  background: #141b2c; border: 1px solid #2a3550; border-radius: 10px;
  max-height: 260px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.gx-find-results.open { display: block; }
.gx-find-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 13px; cursor: pointer;
  font: 400 13px var(--sans); color: #dbe4f7; border-bottom: 1px solid rgba(255,255,255,.05);
}
.gx-find-item:last-child { border-bottom: 0; }
.gx-find-item:hover { background: rgba(255,255,255,.06); }
.gx-find-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-find-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.gx-find-dot.e { background: #4d8bff; }
.gx-find-dot.d { background: #7fe3ac; }
.gx-status {
  position: absolute; top: 14px; left: 16px; font: 500 12.5px var(--mono);
  color: #aab6d0; background: rgba(10,14,24,.6); padding: 6px 11px; border-radius: 8px;
  pointer-events: none;
}
/* Animation de chargement de la galaxie */
.gx-loading {
  position: absolute; inset: 0; z-index: 5; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  background: radial-gradient(circle at center, rgba(12,17,30,.35), rgba(10,14,24,.7));
  backdrop-filter: blur(2px);
}
.gx-loading.on { display: flex; }
.gx-orbit { position: relative; width: 54px; height: 54px; animation: gx-spin 1s linear infinite; }
.gx-orbit span {
  position: absolute; top: 50%; left: 50%; width: 11px; height: 11px;
  margin: -5.5px 0 0 -5.5px; border-radius: 50%;
}
.gx-orbit span:nth-child(1) { transform: rotate(0deg) translateX(21px); background: #4d8bff; }
.gx-orbit span:nth-child(2) { transform: rotate(120deg) translateX(21px); background: #7fe3ac; }
.gx-orbit span:nth-child(3) { transform: rotate(240deg) translateX(21px); background: #fff; }
.gx-loading-txt { font: 500 12.5px var(--mono); color: #aab6d0; letter-spacing: .02em; }
@keyframes gx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gx-orbit { animation-duration: 3s; } }

.gx-legend {
  position: absolute; bottom: 14px; left: 16px; display: flex; flex-wrap: wrap;
  gap: 8px 16px; font: 500 12px var(--sans); color: #c4cde0;
  background: rgba(10,14,24,.6); padding: 9px 13px; border-radius: 10px;
}
.gx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gx-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-sizing: border-box; }
.gx-note { margin: 12px 2px 0; font: 400 12.5px var(--sans); color: var(--muted); }

/* Boutons zoom / ajuster */
.gx-fab { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 6px; }
.gx-fab button {
  width: 38px; height: 38px; border: 1px solid #2a3550; border-radius: 9px;
  background: rgba(16,22,38,.8); color: #dbe4f7; font: 500 18px var(--sans);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.gx-fab button:hover { background: rgba(30,42,72,.9); border-color: var(--blue-mid); }

/* Panneau de détails d'un nœud */
.gx-panel {
  position: absolute; top: 14px; left: 16px; width: 288px; max-width: calc(100% - 32px);
  background: rgba(14,20,35,.92); border: 1px solid #26314c; border-radius: 14px;
  padding: 18px 20px; color: #e7edfb; backdrop-filter: blur(8px);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.7);
}
.gx-panel-x {
  position: absolute; top: 10px; right: 12px; border: 0; background: none;
  color: #8b97b5; font-size: 22px; line-height: 1; cursor: pointer;
}
.gx-panel-type { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #7fa0d4; }
.gx-panel-name { font: 600 18px var(--serif); margin: 4px 0 6px; padding-right: 16px; }
.gx-panel-meta { font: 400 12.5px var(--mono); color: #97a3c2; margin-bottom: 12px; }
.gx-panel-facts { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.gx-fact { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,.07); }
.gx-fact:last-child { border-bottom: 0; padding-bottom: 0; }
.gx-fact span { font: 500 11.5px var(--sans); color: #8090b0; text-transform: uppercase; letter-spacing: .03em; flex: none; }
.gx-fact b { font: 500 13px var(--sans); color: #e6ecf8; text-align: right; }
.gx-fact.muted { color: #8090b0; font: 400 12.5px var(--sans); justify-content: flex-start; }
/* Retraçage : chemin jusqu'à la société de départ */
.gx-panel-trace:empty { display: none; }
.gx-panel-trace { margin-bottom: 12px; padding: 12px 14px; border-radius: 10px;
  background: rgba(255,193,84,.08); border: 1px solid rgba(255,193,84,.25); }
.gx-trace-title { font: 600 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #ffc154; margin-bottom: 8px; }
.gx-trace-step { display: flex; align-items: center; gap: 8px; font: 500 12.5px var(--sans); color: #e6ecf8; }
.gx-trace-step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-trace-arrow { color: #ffc154; font-size: 12px; margin-left: 3px; line-height: 1.1; }
.gx-trace-empty { font: 400 12.5px var(--sans); color: #97a3c2; }
.gx-trace-btn { color: #ffd68a !important; border-color: rgba(255,193,84,.4) !important; }
.gx-trace-btn:hover { background: rgba(255,193,84,.12) !important; }
.gx-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-panel-actions .btn.ghost { background: transparent; color: #bcd0f5; border-color: #33405f; }
.gx-panel-actions .btn.ghost:hover { background: rgba(255,255,255,.06); }

@media (max-width: 640px) {
  .gx-controls { flex-direction: column; align-items: stretch; }
  .gx-legend { font-size: 11px; gap: 6px 10px; max-width: 60%; }
  /* Panneau en feuille inférieure sur mobile */
  .gx-panel { top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: none;
    border-radius: 16px 16px 0 0; }
  /* Le chercheur prend le haut (hors boutons zoom), le compteur passe dessous */
  .gx-find { left: 12px; right: 58px; width: auto; transform: none; }
  .gx-status { top: 60px; left: 12px; }
}

/* Aperçu galaxie sur la fiche */
.gx-mini { position: relative; border-radius: 12px; overflow: hidden; background: #0a0e18; height: 300px; }
.gx-mini canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.gx-mini .gx-status { font-size: 11.5px; }

@media (max-width: 640px) {
  .gx-controls { flex-direction: column; align-items: stretch; }
  .gx-legend { font-size: 11px; gap: 6px 10px; }
}

/* --- Messages flash ---------------------------------------- */
.flash {
  padding: 12px 16px; border-radius: 10px; font: 500 13.5px var(--sans);
  margin-bottom: 10px; border: 1px solid transparent;
}
.flash-ok { background: var(--green-bg); color: var(--green); border-color: #cce9d9; }
.flash-error { background: var(--red-bg); color: var(--red); border-color: #f3d3ce; }

/* --- Formulaires d'authentification ------------------------ */
.auth-wrap { max-width: 420px; margin: 48px auto; padding: 0 20px; }
.auth-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 32px 30px; box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 6px; font: 600 24px var(--serif); }
.auth-card .sub { margin: 0 0 22px; font: 400 14px var(--sans); color: var(--gray); }
.field { margin-bottom: 16px; }
.field label { display: block; font: 500 13px var(--sans); color: var(--ink); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 9px; font: 400 15px var(--sans); color: var(--ink); outline: 0;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,58,143,.12); }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 6px; padding: 12px; }
.auth-alt { margin-top: 20px; text-align: center; font: 400 13.5px var(--sans); color: var(--gray); }
.hint { font: 400 12px var(--sans); color: var(--muted); margin-top: 5px; }

/* --- Espace / dashboard ------------------------------------ */
.space-head { padding: 34px 0 8px; }
.space-head .eyebrow { text-align: left; }
.space-head h1 { margin: 0; font: 600 30px var(--serif); letter-spacing: -.01em; }
.space-head p { margin: 6px 0 0; color: var(--gray); font: 400 15px var(--sans); }
/* Les styles du tableau de bord admin sont dans admin.css (chargé seulement
   dans l'espace d'administration, pour ne pas alourdir les pages publiques). */

/* --- Responsive -------------------------------------------- */
@media (max-width: 900px) {
  .site-header { gap: 14px; height: 60px; }
  .main-nav, .header-actions { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu { top: 60px; }

  .search-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 20px; }
  .filters > div:first-child { grid-column: 1 / -1; }
  .fiche-grid { grid-template-columns: 1fr; }

  /* La colonne latérale (score, carte) passe au-dessus du contenu */
  .fiche-grid .col:last-child { order: -1; }
}

@media (max-width: 640px) {
  .hero { padding: 32px 0 8px; }
  .hero h1 { font-size: 26px; }
  .features { grid-template-columns: 1fr; gap: 12px; }

  /* Carte de résultat : l'aparté passe sous les métadonnées */
  .result-card { flex-wrap: wrap; }
  .result-aside { flex-direction: row; align-items: center; width: 100%;
    justify-content: space-between; margin-top: 4px; }

  .profile-head { gap: 14px; }
  .profile-id h1 { font-size: 22px; display: block; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; justify-content: center; }
  .tabs { gap: 18px; }

  .kv, .stat-row { grid-template-columns: 1fr 1fr; }
  .docs { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 20px 28px; }
  .hero-stats .value { font-size: 24px; }
}

@media (max-width: 380px) {
  .kv, .stat-row { grid-template-columns: 1fr; }
  .brand-name { font-size: 18px; }
}

/* ============================================================
   Page Galaxie — onglets, vue texte (dossier) et OSINT
   ============================================================ */
.gx-tabs { display: flex; gap: 4px; margin: 22px 0 0; border-bottom: 1px solid var(--line); }
.gx-tab {
  border: 0; background: none; cursor: pointer; padding: 11px 18px;
  font: 600 14px var(--sans); color: var(--gray); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.gx-tab:hover { color: var(--ink); }
.gx-tab.on { color: var(--blue); border-bottom-color: var(--blue); }
.gx-tabpanel { margin-top: 4px; }
.gx-tabpanel[hidden] { display: none; }

/* Chargement paresseux du dossier */
.doss-lazy { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 70px 20px; color: var(--muted); font: 500 14px var(--sans); }
.doss-lazy .gx-orbit { width: 44px; height: 44px; }
.doss-empty { padding: 50px 20px; text-align: center; color: var(--gray); }

/* --- Vue texte (dossier) --- */
.doss { margin-top: 20px; }
.doss-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.doss-title { margin: 0; font: 600 24px/1.2 var(--serif); letter-spacing: -.01em; display: flex;
  align-items: center; gap: 10px; flex-wrap: wrap; }
.doss-sub { margin: 6px 0 0; color: var(--gray); font: 400 14px var(--sans); }
.doss-tools { display: flex; gap: 8px; flex: none; }
.doss-sec { padding: 22px 0; border-bottom: 1px solid var(--line-faint); }
.doss-sec:last-of-type { border-bottom: 0; }
.doss-sec h3 { margin: 0 0 14px; font: 600 15px var(--sans); color: var(--ink);
  display: flex; align-items: center; gap: 9px; }
.doss-sec-sub, .osint-sub { margin: -8px 0 14px; color: var(--gray); font: 400 13px var(--sans); }
.doss-count { display: inline-flex; min-width: 20px; padding: 1px 7px; border-radius: 999px;
  background: var(--tint); color: var(--blue); font: 700 11.5px var(--sans); }
.doss-objet { margin-top: 14px; }
.doss-objet p { margin: 4px 0 0; font: 400 14px/1.6 var(--sans); color: var(--gray); }

.doss-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.doss-people > li { padding: 12px 0; border-top: 1px solid var(--line-faint); }
.doss-people > li:first-child { border-top: 0; }
.doss-person { display: flex; align-items: center; gap: 12px; }
.round.sm { width: 34px; height: 34px; font-size: 12px; }
.doss-person-n { font: 600 14px var(--sans); color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doss-person-r { font: 400 12.5px var(--sans); color: var(--gray); margin-top: 1px; }
.doss-mandats { margin: 8px 0 0 46px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.doss-mandats-lbl { font: 500 12px var(--sans); color: var(--muted); }
.doss-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line-soft); font: 500 12px var(--sans); color: var(--ink); }
.doss-chip:hover { border-color: var(--blue); color: var(--blue); }
.doss-chip.off { color: var(--gray); text-decoration: line-through; text-decoration-color: var(--faint); }
.doss-chip.root { border-color: var(--blue); background: var(--tint); color: var(--blue); font-weight: 600; }
.doss-be { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doss-be li { font: 500 14px var(--sans); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.doss-table { width: 100%; border-collapse: collapse; }
.doss-table th, .doss-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-faint);
  font: 400 13.5px var(--sans); vertical-align: top; }
.doss-table th { font: 600 11.5px var(--sans); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
/* Colonnes courtes du tableau OSINT (dirigeant, fonction, nb) : pas de retour à la ligne */
.osint-sec .doss-table td:nth-child(1),
.osint-sec .doss-table td:nth-child(2),
.osint-sec .doss-table td:nth-child(3) { white-space: nowrap; }
.doss-table th.num, .doss-table td.num { text-align: center; }
.doss-table td .sm { font-size: 11.5px; }
.doss-table a { font-weight: 500; }

.doss-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.doss-timeline li { position: relative; display: flex; gap: 14px; padding: 7px 0 7px 18px;
  border-left: 2px solid var(--line); align-items: baseline; }
.doss-timeline li::before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--faint); }
.doss-timeline li.is-root::before { background: var(--blue); }
.doss-tl-date { flex: none; width: 120px; color: var(--muted); font-size: 12.5px; }
.doss-tl-label { font: 500 13.5px var(--sans); }
.doss-src { margin-top: 18px; }

/* --- OSINT --- */
.osint { margin-top: 20px; display: flex; flex-direction: column; gap: 22px; }
.osint-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.osint-m { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.osint-m .v { font: 600 24px var(--serif); color: var(--ink); }
.osint-m .k { font: 400 12px var(--sans); color: var(--muted); margin-top: 2px; }
.osint-m.ok .v { color: var(--green); }
.osint-m.danger .v { color: var(--red); }
.osint-sec { padding: 20px 22px; }
.osint-sec h3 { margin: 0 0 4px; font: 600 15px var(--sans); display: flex; align-items: center; gap: 9px; }
.osint-count { display: inline-block; min-width: 22px; text-align: center; padding: 2px 8px; border-radius: 8px;
  background: var(--tint); color: var(--blue); font: 700 12.5px var(--mono); }
.osint-others { display: flex; flex-wrap: wrap; gap: 5px; }
.osint-addr { padding: 12px 0; border-top: 1px solid var(--line-faint); }
.osint-addr:first-of-type { border-top: 0; }
.osint-addr-h { display: flex; align-items: center; gap: 8px; font: 600 13.5px var(--sans); color: var(--ink); flex-wrap: wrap; }
.osint-addr-h svg { color: var(--gray); }
.osint-addr-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 22px; }

/* Répartition sectorielle (barres, teinte unique) */
.osint-bars { display: flex; flex-direction: column; gap: 9px; }
.osint-bar-row { display: grid; grid-template-columns: minmax(120px, 230px) 1fr 34px; align-items: center; gap: 12px; }
.osint-bar-lbl { font: 500 12.5px var(--sans); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.osint-bar-track { height: 10px; background: var(--line-faint); border-radius: 999px; overflow: hidden; }
.osint-bar { height: 100%; background: var(--blue); border-radius: 999px; min-width: 3px; }
.osint-bar-val { text-align: right; font-size: 12.5px; color: var(--gray); }

/* Pivots externes */
.osint-pivot-block { padding: 10px 0; }
.osint-pivot-lbl { font: 600 13px var(--sans); color: var(--ink); margin-bottom: 8px; }
.osint-pivots { display: flex; flex-wrap: wrap; gap: 7px; }
.osint-pivot { display: inline-block; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font: 500 12.5px var(--sans); color: var(--blue); }
.osint-pivot:hover { background: var(--tint); border-color: var(--blue); }
.osint-pivot.sm { padding: 5px 10px; font-size: 12px; color: var(--gray); }
.osint-pivot.sm:hover { color: var(--blue); }
.osint-pivot-people { margin-top: 6px; border-top: 1px solid var(--line-faint); padding-top: 6px; }

@media (max-width: 640px) {
  .doss-tl-date { width: 84px; }
  .osint-bar-row { grid-template-columns: 1fr 34px; }
  .osint-bar-lbl { grid-column: 1 / -1; }
}

/* Impression : ne garder que le dossier texte */
@media print {
  .site-header, .site-footer, .gx-head, .gx-tabs, .gx-note, .doss-tools,
  .gx-tabpanel[data-panel="galaxie"], .gx-tabpanel[data-panel="osint"] { display: none !important; }
  .gx-tabpanel[hidden] { display: block !important; }
  .doss-chip, .osint-pivot { border-color: #bbb; }
  body { background: #fff; }
}

/* En-tête de navigation par secteur d'activité (NAF) */
.browse-head { margin: 22px 0 6px; }
.browse-head h1 { margin: 6px 0 0; font: 600 clamp(22px, 3.4vw, 30px)/1.15 var(--serif); letter-spacing: -.01em; }

/* Gestion des sites web sur la fiche (admin) */
.site-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.site-item { display: inline-flex; align-items: center; gap: 6px; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 10px; }
.site-item a { font-size: 13px; }
.site-x { border: 0; background: var(--line-faint); color: var(--gray); width: 18px; height: 18px;
  border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.site-x:hover { background: var(--red-bg); color: var(--red); }
.site-add { display: flex; gap: 8px; margin-top: 12px; max-width: 460px; }
.site-add input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: 400 13.5px var(--sans); }
.site-add input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--tint); }
