:root {
  --vert: #2d5a3d;
  --vert-clair: #eaf3ec;
  --beige: #faf7f2;
  --encre: #2c2c2c;
  --gris: #777;
  --bleu-h: #dbe9f5;
  --rose-f: #f7e3e8;
  --gris-u: #eee;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--beige);
  color: var(--encre);
  line-height: 1.55;
}

header { background: var(--vert); }
nav {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
nav a { color: #fff; text-decoration: none; font-size: 15px; }
nav a:hover { text-decoration: underline; }
nav .brand { font-size: 18px; font-weight: bold; margin-right: 8px; }
.searchbar { margin-left: auto; display: flex; gap: 4px; }
.searchbar input { padding: 5px 10px; border: none; border-radius: 4px; font-size: 14px; min-width: 210px; }
.searchbar button { border: none; background: #fff; border-radius: 4px; cursor: pointer; padding: 5px 8px; }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
footer { text-align: center; color: var(--gris); font-size: 13px; padding: 18px; }

h1 { color: var(--vert); font-size: 28px; margin: 12px 0; }
h2 { color: var(--vert); font-size: 19px; margin: 22px 0 8px; border-bottom: 1px solid #ddd; padding-bottom: 3px; }
a { color: #1a5c8a; }

.flash { background: var(--vert-clair); border-left: 4px solid var(--vert); padding: 10px 14px; margin: 10px 0; border-radius: 4px; }

.btn {
  display: inline-block; background: var(--vert); color: #fff !important;
  padding: 8px 16px; border-radius: 6px; text-decoration: none;
  border: none; font-size: 15px; cursor: pointer; font-family: inherit;
}
.btn:hover { opacity: 0.9; }
.btn.small { padding: 4px 11px; font-size: 13px; }
.btn.active { background: #17482a; box-shadow: inset 0 0 0 2px #fff3; }

.cards { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
.card {
  background: #fff; border: 1px solid #e2ddd2; border-radius: 10px;
  padding: 14px 20px; min-width: 130px; text-align: center;
  color: var(--gris); font-size: 13px;
}
.card .big { font-size: 30px; color: var(--vert); font-weight: bold; }

.meta-info { color: var(--gris); font-size: 14px; }

.upload { background: #fff; border: 1px solid #e2ddd2; border-radius: 10px; padding: 16px; margin: 14px 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

table.liste { border-collapse: collapse; width: 100%; background: #fff; border-radius: 8px; overflow: hidden; }
table.liste th, table.liste td { text-align: left; padding: 7px 12px; border-bottom: 1px solid #eee; font-size: 14.5px; }
table.liste th { background: var(--vert-clair); color: var(--vert); }
table.liste td.num { text-align: right; width: 50px; color: var(--gris); }
td.barcell { width: 40%; }
.bar { height: 12px; background: var(--vert); border-radius: 3px; min-width: 2px; opacity: 0.7; }

.dates { color: var(--gris); font-size: 0.88em; }
.unknown, .private { color: var(--gris); font-style: italic; }
.private-notice { background: #fdf3e3; border-left: 4px solid #d9a441; padding: 10px 14px; border-radius: 4px; }

table.details { background: #fff; border-radius: 8px; border-collapse: collapse; }
table.details th { text-align: right; padding: 7px 14px; color: var(--vert); vertical-align: top; white-space: nowrap; }
table.details td { padding: 7px 14px; }

.union { background: #fff; border: 1px solid #e2ddd2; border-radius: 8px; padding: 4px 16px; margin: 10px 0; }
.notes { background: #fff; border: 1px solid #e2ddd2; border-radius: 8px; padding: 12px 16px; white-space: pre-wrap; font-size: 14.5px; }

.alphabet a { font-size: 17px; font-weight: bold; margin-right: 6px; }
.tags { line-height: 2.2; }
.tag {
  background: #fff; border: 1px solid #d8d2c4; border-radius: 14px;
  padding: 3px 11px; text-decoration: none; font-size: 14px; white-space: nowrap;
}
.tag:hover { background: var(--vert-clair); }
.tag .count { color: var(--gris); font-size: 12px; }

.stats-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 30px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hint { color: var(--gris); font-size: 13px; }
.pagination { margin-top: 14px; display: flex; gap: 10px; }

/* Arbre */
#tree-container { background: #fff; border: 1px solid #e2ddd2; border-radius: 10px; min-height: 500px; overflow: hidden; }
.tree-link { fill: none; stroke: #b9c9be; stroke-width: 1.6; }
.node-box { stroke: #9db3a5; stroke-width: 1; }
.node-box.sex-m { fill: var(--bleu-h); }
.node-box.sex-f { fill: var(--rose-f); }
.node-box.sex-u { fill: var(--gris-u); }
.node-box.sex-p { fill: #f5f5f5; stroke-dasharray: 4 3; }
.node-name { font-family: Georgia, serif; font-size: 13px; fill: var(--encre); }
.node-dates { font-family: Georgia, serif; font-size: 11px; fill: var(--gris); }

@media (max-width: 700px) {
  .searchbar { margin-left: 0; width: 100%; }
  .searchbar input { flex: 1; }
}

/* lien vers l'arbre interactif dans les listes */
.liste a.dyn { margin-left: 6px; font-size: 12px; text-decoration: none; color: var(--encre-pale); }
.liste a.dyn:hover { color: var(--marge); }
