/*
 * Mise en page de l'arbre : barre d'outils, résultats de recherche, panneau de fiche.
 * Les couleurs reprennent les variables du thème « généalogie » quand elles existent,
 * avec des valeurs de repli sobres. Aucune ressource externe.
 */
.tngwp-arbre-wrap {
	--tngwp-bg: var(--gen-bg, #fbf7ee);
	--tngwp-fg: var(--gen-text, #3b2a20);
	--tngwp-accent: var(--gen-accent, #7a1f2b);
	--tngwp-border: var(--gen-border, #d8cdb8);
	/* Traits entre les personnes : family-chart les dessine en blanc (prévu pour un fond sombre). */
	--tngwp-line: #4a4038;
	position: relative;
	margin: 1rem 0;
	color: var(--tngwp-fg);
}

/* Par défaut l'arbre occupe toute la largeur de la fenêtre, quelle que soit la colonne du thème
   (largeur="normale" dans le shortcode pour garder la colonne du thème). */
.tngwp-arbre-wrap--pleine {
	box-sizing: border-box;
	/* --tngwp-decalage : largeur d'un menu fixe à gauche (thème « Famille »), 0 sinon. La colonne du thème
	   est centrée dans l'espace à droite du menu : on y étale l'arbre sans déborder ni passer sous le menu. */
	width: calc(100vw - var(--tngwp-decalage, 0px));
	max-width: calc(100vw - var(--tngwp-decalage, 0px));
	margin-left: calc(50% - 50vw + var(--tngwp-decalage, 0px) / 2);
	margin-right: 0;
	padding-inline: clamp(8px, 2vw, 28px);
}

@media (min-width: 901px) {
	.tngwp-arbre-wrap--pleine {
		--tngwp-decalage: var(--largeur-menu, 0px);
	}
}

body:has(.tngwp-arbre-wrap--pleine) {
	overflow-x: clip;
}

@media (prefers-color-scheme: dark) {
	.tngwp-arbre-wrap {
		--tngwp-bg: var(--gen-bg, #211a16);
		--tngwp-fg: var(--gen-text, #eadfce);
		--tngwp-accent: var(--gen-accent, #d89aa3);
		--tngwp-border: var(--gen-border, #4a3d34);
		--tngwp-line: #cbb89f;
	}
}

/* ---- Arbre : cartes verticales façon TNG, traits à angle droit ---- */

.tngwp-arbre-wrap .f3 {
	--text-color: #2b2118;
}

.tngwp-arbre-wrap .f3 .link {
	stroke: var(--tngwp-line);
	stroke-width: 1.5px;
}

.tngwp-arbre-wrap .f3 .link.f3-path-to-main {
	stroke: var(--tngwp-accent);
	stroke-width: 3px;
}

/* La taille des cartes doit rester d'accord avec CARD_W / CARD_H de tree.js. */
.tngwp-card {
	--tngwp-card-bg: #ddd5c9;
	position: relative;
	box-sizing: border-box;
	width: 160px;
	height: 176px;
	padding: 10px 8px 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	background: var(--tngwp-card-bg);
	border: 1px solid #5c5248;
	border-radius: 8px;
	box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.25);
	color: #2b2118;
	text-align: center;
	font-size: 16px;
	line-height: 1.25;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.f3 div.card:hover .tngwp-card {
	box-shadow: 2px 3px 9px rgba(0, 0, 0, 0.45);
}

.f3 div.card-main .tngwp-card {
	border-color: var(--tngwp-accent);
	border-width: 2px;
	box-shadow: 0 0 0 3px rgba(122, 28, 44, 0.25), 2px 3px 8px rgba(0, 0, 0, 0.35);
}

.tngwp-card-photo {
	flex: 0 0 auto;
	width: 56px;
	height: 68px;
	border-radius: 2px;
	background-color: #cdd8de;
	background-repeat: no-repeat;
	background-position: center bottom;
	background-size: 100% 100%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 76 92'%3E%3Cellipse cx='38' cy='34' rx='16' ry='20' fill='%23fff'/%3E%3Cpath d='M6 92c0-24 14-34 32-34s32 10 32 34z' fill='%23fff'/%3E%3C/svg%3E");
}

.tngwp-card-photo {
	position: relative;
	overflow: hidden;
}

/* Photo TNG par-dessus la silhouette ; le cadrage garde le haut (visage). */
.tngwp-card-photo img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
	object-position: center top;
}

.tngwp-card-photo--f {
	background-color: #ecd2d6;
}

.tngwp-card-photo--private {
	background-color: #d3cdc6;
}

.tngwp-card-name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	overflow-wrap: anywhere;
	text-decoration: none;
	color: #2f4d66;
	font-weight: 600;
}

.tngwp-card--f .tngwp-card-name {
	color: #7a2e3f;
}

.tngwp-card--private .tngwp-card-name {
	color: #5c5248;
	text-decoration: none;
	font-style: italic;
}

.tngwp-card-dates {
	margin-top: auto;
	font-size: 14px;
	white-space: nowrap;
}

.tngwp-card-sex {
	margin-right: 4px;
	font-size: 17px;
	font-weight: 700;
}

.tngwp-card-sex--m {
	color: #5b6fd6;
}

.tngwp-card-sex--f {
	color: #e0607e;
}

.tngwp-card-more {
	position: absolute;
	left: 50%;
	width: 0;
	height: 0;
	margin-left: -9px;
	border-left: 9px solid transparent;
	border-right: 9px solid transparent;
}

.tngwp-card-more--up {
	top: -13px;
	border-bottom: 11px solid #e0a030;
}

.tngwp-card-more--down {
	bottom: -13px;
	border-top: 11px solid #e0a030;
}

.tngwp-arbre-wrap .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.tngwp-arbre-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	align-items: flex-end;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.tngwp-arbre-search {
	position: relative;
	flex: 1 1 16rem;
	max-width: 26rem;
}

.tngwp-arbre-search label {
	display: block;
	font-size: 0.85em;
	margin-bottom: 0.2rem;
}

.tngwp-arbre-q {
	box-sizing: border-box;
	width: 100%;
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--tngwp-border);
	border-radius: 4px;
	background: var(--tngwp-bg);
	color: inherit;
	font: inherit;
}

.tngwp-arbre-results {
	position: absolute;
	z-index: 20;
	left: 0;
	right: 0;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
	max-height: 18rem;
	overflow-y: auto;
	background: var(--tngwp-bg);
	border: 1px solid var(--tngwp-border);
	border-radius: 4px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.tngwp-arbre-results[hidden],
.tngwp-arbre-panel[hidden] {
	display: none;
}

.tngwp-arbre-results li {
	margin: 0;
}

.tngwp-arbre-results button,
.tngwp-arbre-results .tngwp-arbre-note {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 0.5rem 0.65rem;
	text-align: left;
	background: none;
	border: 0;
	color: inherit;
	font: inherit;
}

.tngwp-arbre-results button {
	cursor: pointer;
}

.tngwp-arbre-results button:hover,
.tngwp-arbre-results button:focus-visible {
	background: color-mix(in srgb, var(--tngwp-accent) 12%, transparent);
	outline: none;
}

.tngwp-arbre-note {
	font-size: 0.9em;
	opacity: 0.8;
}

.tngwp-arbre-years {
	opacity: 0.7;
	font-size: 0.9em;
	margin-left: 0.35em;
}

.tngwp-arbre-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.tngwp-arbre-back {
	padding: 0.45rem 0.9rem;
	background: var(--tngwp-bg);
	color: inherit;
	border: 1px solid var(--tngwp-border);
	border-radius: 4px;
	font: inherit;
	cursor: pointer;
}

.tngwp-arbre-back:disabled {
	opacity: 0.45;
	cursor: default;
}

.tngwp-arbre-modes {
	display: inline-flex;
	border: 1px solid var(--tngwp-border);
	border-radius: 4px;
	overflow: hidden;
}

.tngwp-arbre-modes button {
	padding: 0.45rem 0.9rem;
	background: var(--tngwp-bg);
	color: inherit;
	border: 0;
	border-right: 1px solid var(--tngwp-border);
	font: inherit;
	cursor: pointer;
}

.tngwp-arbre-modes button:last-child {
	border-right: 0;
}

.tngwp-arbre-modes button[aria-pressed="true"] {
	background: var(--tngwp-accent);
	color: #fff;
}

.tngwp-arbre-stage {
	position: relative;
	/* Contexte d'empilement propre : les z-index internes de family-chart (jusqu'à 10)
	   ne doivent ni recouvrir le panneau ni passer au-dessus de la liste de résultats. */
	isolation: isolate;
	border: 1px solid var(--tngwp-border);
	border-radius: 4px;
	overflow: hidden;
	background: var(--tngwp-bg);
}

.tngwp-arbre-panel {
	position: absolute;
	z-index: 30;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(22rem, 100%);
	box-sizing: border-box;
	padding: 1rem 1.1rem 1.25rem;
	overflow-y: auto;
	background: var(--tngwp-bg);
	color: var(--tngwp-fg);
	border-left: 1px solid var(--tngwp-border);
	box-shadow: -6px 0 18px rgba(0, 0, 0, 0.12);
}

.tngwp-arbre-panel:focus {
	outline: none;
}

.tngwp-arbre-panel h3 {
	margin: 0 2rem 0.6rem 0;
	font-size: 1.25rem;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.tngwp-arbre-panel h4 {
	margin: 1.1rem 0 0.35rem;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tngwp-accent);
}

.tngwp-arbre-panel dl {
	margin: 0;
}

.tngwp-arbre-panel dt {
	font-weight: 600;
	margin-top: 0.4rem;
}

.tngwp-arbre-panel dd {
	margin: 0;
}

.tngwp-arbre-panel ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tngwp-arbre-panel li {
	margin: 0.15rem 0;
}

.tngwp-arbre-panel .tngwp-arbre-link {
	padding: 0;
	background: none;
	border: 0;
	color: var(--tngwp-accent);
	font: inherit;
	text-align: left;
	text-decoration: underline;
	cursor: pointer;
}

.tngwp-arbre-panel .tngwp-arbre-role {
	opacity: 0.7;
	font-size: 0.85em;
	margin-right: 0.35em;
}

.tngwp-arbre-close {
	position: absolute;
	top: 0.5rem;
	right: 0.6rem;
	width: 2rem;
	height: 2rem;
	background: none;
	border: 0;
	color: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.tngwp-arbre-fiche {
	display: inline-block;
	margin-top: 1.25rem;
	padding: 0.5rem 0.9rem;
	background: var(--tngwp-accent);
	color: #fff;
	border-radius: 4px;
	text-decoration: none;
}

.tngwp-arbre-notice,
.tngwp-arbre-error {
	font-style: italic;
}

@media (max-width: 40rem) {
	/* Sur téléphone, la fiche recouvre l'arbre sur toute la largeur. */
	.tngwp-arbre-panel {
		width: 100%;
		border-left: 0;
	}
}

/* Galerie d'images dans le panneau */
.tngwp-arbre-galerie { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.tngwp-arbre-galerie img { display: block; width: 100%; height: 84px; object-fit: cover; border: 1px solid #ccc; border-radius: 3px; }
.tngwp-arbre-vide { font-size: .85rem; color: #666; margin: 0 0 .5rem; }
.tngwp-arbre-note { white-space: pre-line; margin: 0 0 .6rem; line-height: 1.45; overflow-wrap: anywhere; }
.tngwp-arbre-legende { display: block; font-size: .75rem; line-height: 1.2; margin-top: .15rem; overflow-wrap: anywhere; }

/* Carte « Privé » : lien et initiales facultatives */
.tngwp-card-hint { margin-top: auto; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.tngwp-card-hint + .tngwp-card-dates { margin-top: 0; }
.tngwp-card-initials { font-size: 15px; font-weight: 600; letter-spacing: .04em; color: #5c5248; }
.tngwp-card-relation { font-size: 13.5px; font-style: italic; color: #6f655b; }

/* ---- Vignettes de documents (panneau) et visionneuse modale ------------------------- */
.tngwp-arbre-galerie li { margin: 0; padding: 0; }
.tngwp-arbre-galerie .tngwp-arbre-vignette { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; cursor: zoom-in; font: inherit; color: inherit; }
.tngwp-arbre-galerie .tngwp-arbre-vignette:focus-visible { outline: 3px solid #1a5fb4; outline-offset: 2px; }

html.tngwp-viewer-open { overflow: hidden; }
.tngwp-viewer { position: fixed; inset: 0; z-index: 2147483000; display: flex; flex-direction: column; background: #0c0c0e; color: #f2f2f2; font: 15px/1.4 system-ui, sans-serif; text-align: left; }
.tngwp-viewer *, .tngwp-viewer *::before, .tngwp-viewer *::after { box-sizing: border-box; }
.tngwp-viewer .tngwp-viewer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .75rem; background: rgba(0, 0, 0, .5); }
.tngwp-viewer .tngwp-viewer-counter { font-weight: 600; min-width: 3.5rem; }
.tngwp-viewer .tngwp-viewer-tools { display: flex; flex-wrap: wrap; gap: .4rem; }
.tngwp-viewer .tngwp-viewer-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; min-width: 2.5rem; margin: 0; padding: .3rem .8rem; border: 1px solid rgba(255, 255, 255, .45); border-radius: 6px; background: #2b2b30; color: #fff; font: inherit; font-size: .9rem; line-height: 1.2; text-decoration: none; text-transform: none; letter-spacing: 0; box-shadow: none; cursor: pointer; }
.tngwp-viewer .tngwp-viewer-btn:hover { background: #44444c; color: #fff; }
.tngwp-viewer .tngwp-viewer-btn:focus-visible { outline: 3px solid #8cc4ff; outline-offset: 2px; }
.tngwp-viewer .tngwp-viewer-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.tngwp-viewer .tngwp-viewer-stage.is-grabbing { cursor: grabbing; }
.tngwp-viewer .tngwp-viewer-img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; transform-origin: center center; will-change: transform; pointer-events: none; background: #fff; }
.tngwp-viewer.is-loading .tngwp-viewer-img, .tngwp-viewer.is-error .tngwp-viewer-img { visibility: hidden; }
.tngwp-viewer .tngwp-viewer-message { display: none; position: absolute; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%); text-align: center; }
.tngwp-viewer.is-error .tngwp-viewer-message { display: block; }
.tngwp-viewer .tngwp-viewer-prev, .tngwp-viewer .tngwp-viewer-next { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 4rem; font-size: 2rem; padding: 0; background: rgba(30, 30, 34, .8); }
.tngwp-viewer .tngwp-viewer-prev { left: .5rem; }
.tngwp-viewer .tngwp-viewer-next { right: .5rem; }
.tngwp-viewer [hidden] { display: none; }
/* Visionneuse ? table de lecture ? : le document pose sur un plateau sombre, une fiche claire a son cote.
   Encre violette (tampons des registres), polices Newsreader hebergees avec l'extension (aucun appel externe). */
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('../fonts/newsreader-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 200 800; font-display: swap; src: url('../fonts/newsreader-latin-wght-italic.woff2') format('woff2'); }
.tngwp-viewer { --v-ink: #1d2530; --v-muted: #66726f; --v-violet: #5a3d7a; --v-violet-light: #b79bd6; --v-paper: #f3f4ef; --v-line: #cfd3c9; --v-serif: 'Newsreader', Georgia, 'Times New Roman', serif; background: radial-gradient(ellipse at 38% 45%, #33403f, #1a2224 78%); }
.tngwp-viewer .tngwp-viewer-bar { background: transparent; padding: .7rem 1.2rem; }
.tngwp-viewer .tngwp-viewer-counter { color: #9fb0ad; font-weight: 500; }
.tngwp-viewer .tngwp-viewer-btn { background: transparent; border-color: rgba(255, 255, 255, .22); color: #dfe6e3; }
.tngwp-viewer .tngwp-viewer-btn:hover { background: rgba(255, 255, 255, .1); }
.tngwp-viewer .tngwp-viewer-prev, .tngwp-viewer .tngwp-viewer-next { background: rgba(26, 34, 36, .75); }
.tngwp-viewer .tngwp-viewer-body { display: flex; flex: 1 1 auto; min-height: 0; gap: 1.5rem; padding: 0 1.5rem 1.5rem; }
.tngwp-viewer .tngwp-viewer-main { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; }
.tngwp-viewer .tngwp-viewer-main .tngwp-viewer-stage { flex: 1 1 auto; min-height: 0; }
.tngwp-viewer .tngwp-viewer-img { box-shadow: 0 22px 50px rgba(0, 0, 0, .65); }
.tngwp-viewer .tngwp-viewer-strip { display: flex; flex: 0 0 auto; justify-content: center; gap: .6rem; padding: .8rem 0 0; }
.tngwp-viewer .tngwp-viewer-thumb { display: block; flex: 0 0 auto; width: 72px; margin: 0; padding: 0; border: 2px solid transparent; border-radius: 2px; background: #3a4548; box-shadow: none; cursor: pointer; opacity: .75; }
.tngwp-viewer .tngwp-viewer-thumb img { display: block; width: 100%; height: 50px; margin: 0; padding: 0; border: 0; border-radius: 0; object-fit: cover; }
.tngwp-viewer .tngwp-viewer-thumb:hover { opacity: 1; }
.tngwp-viewer .tngwp-viewer-thumb.is-current { border-color: var(--v-violet-light); opacity: 1; }
.tngwp-viewer .tngwp-viewer-thumb:focus-visible { outline: 3px solid #8cc4ff; outline-offset: 2px; }
.tngwp-viewer .tngwp-viewer-info { position: relative; display: flex; flex: 0 0 min(28rem, 36vw); flex-direction: column; min-height: 0; margin-top: .2rem; background: var(--v-paper); color: var(--v-ink); border: 0; box-shadow: 0 22px 50px rgba(0, 0, 0, .55); font-family: var(--v-serif); }
.tngwp-viewer .tngwp-viewer-info::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--v-violet); }
.tngwp-viewer .tngwp-viewer-head { padding: 1.8rem 2rem .8rem 2.2rem; }
.tngwp-viewer .tngwp-viewer-title { margin: 0 0 .35rem; padding: 0; border: 0; color: var(--v-ink); font: 400 clamp(1.5rem, 2.2vw, 2rem)/1.12 var(--v-serif); letter-spacing: -.005em; }
.tngwp-viewer .tngwp-viewer-meta { margin: 0; color: var(--v-violet); font: italic 400 1.05rem/1.3 var(--v-serif); }
.tngwp-viewer .tngwp-viewer-tabs { display: flex; gap: 1.4rem; padding: 0 2rem 0 2.2rem; border-bottom: 1px solid var(--v-line); }
.tngwp-viewer .tngwp-viewer-tab { appearance: none; margin: 0 0 -1px; padding: .55rem 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; box-shadow: none; color: var(--v-muted); font: 500 1rem/1.2 var(--v-serif); letter-spacing: 0; text-transform: none; cursor: pointer; }
.tngwp-viewer .tngwp-viewer-tab:hover { color: var(--v-ink); }
.tngwp-viewer .tngwp-viewer-tab.is-on { border-bottom-color: var(--v-violet); color: var(--v-ink); }
.tngwp-viewer .tngwp-viewer-tab:focus-visible { outline: 3px solid #8cc4ff; outline-offset: 2px; }
.tngwp-viewer .tngwp-viewer-pane { flex: 1 1 auto; min-height: 0; overflow: auto; padding: .8rem 2rem 2rem 2.2rem; }
.tngwp-viewer .tngwp-viewer-sec { padding: .5rem 0 .6rem; }
.tngwp-viewer .tngwp-viewer-sec h4 { margin: 1.1rem 0 .35rem; padding: 0 0 .25rem; border: 0; border-bottom: 1px solid var(--v-line); color: var(--v-violet); font: 700 1.15rem/1.3 var(--v-serif); letter-spacing: 0; text-transform: none; }
.tngwp-viewer .tngwp-viewer-sec ul { margin: 0 0 .4rem; padding: 0 0 0 1.3rem; list-style: disc; }
.tngwp-viewer .tngwp-viewer-sec li { margin: 0; padding: .22rem 0; color: var(--v-ink); font: 400 1.08rem/1.5 var(--v-serif); overflow-wrap: anywhere; }
.tngwp-viewer .tngwp-viewer-sec li::marker { color: var(--v-violet); }
.tngwp-viewer .tngwp-viewer-sec li strong { font-weight: 700; }
.tngwp-viewer .tngwp-viewer-sec p { margin: 0 0 .6rem; color: var(--v-ink); font: 400 1.1rem/1.6 var(--v-serif); }
.tngwp-viewer .tngwp-viewer-prose { margin: 0; color: var(--v-ink); font: 400 1.1rem/1.7 var(--v-serif); white-space: pre-line; overflow-wrap: anywhere; }
.tngwp-viewer .tngwp-viewer-strip[hidden], .tngwp-viewer .tngwp-viewer-info[hidden], .tngwp-viewer .tngwp-viewer-tabs[hidden], .tngwp-viewer .tngwp-viewer-pane[hidden] { display: none; }
@media (max-width: 800px) {
	.tngwp-viewer .tngwp-viewer-btn { padding: .3rem .55rem; font-size: .8rem; }
	.tngwp-viewer .tngwp-viewer-body { flex-direction: column; gap: .8rem; padding: 0 .6rem .6rem; }
	.tngwp-viewer .tngwp-viewer-main { flex: 1 1 40vh; }
	.tngwp-viewer .tngwp-viewer-thumb { width: 56px; }
	.tngwp-viewer .tngwp-viewer-thumb img { height: 40px; }
	.tngwp-viewer .tngwp-viewer-info { flex: 0 1 auto; max-height: 48vh; margin-top: 0; }
	.tngwp-viewer .tngwp-viewer-head { padding: 1rem 1.2rem .5rem 1.5rem; }
	.tngwp-viewer .tngwp-viewer-tabs { padding: 0 1.2rem 0 1.5rem; }
	.tngwp-viewer .tngwp-viewer-pane { padding: .6rem 1.2rem 1.2rem 1.5rem; }
	.tngwp-viewer .tngwp-viewer-sec dl > div { grid-template-columns: 1fr; gap: 0; }
}

/* Curseur : main pour déplacer l'arbre, doigt sur une carte cliquable. */
.tngwp-arbre-wrap .f3 { cursor: grab; }
.tngwp-arbre-wrap .f3:active:not(:has(.card:active)) { cursor: grabbing; }
.tngwp-arbre-wrap .f3 .card_cont,
.tngwp-arbre-wrap .f3 .card,
.tngwp-arbre-wrap .f3 .card * { cursor: pointer; }

/* ---- Mise en page compacte : recherche et boutons sur une ligne, arbre en hauteur d'écran ---- */
.tngwp-arbre-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .35rem 0; }
.tngwp-arbre-search { display: flex; align-items: center; flex: 1 1 18rem; max-width: 26rem; margin: 0; position: relative; }
.tngwp-arbre-search label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tngwp-arbre-search .tngwp-arbre-q { width: 100%; }
.tngwp-arbre-stage { position: relative; }
.tngwp-arbre-wrap .f3.tngwp-arbre { border: 1px solid var(--tngwp-border); border-radius: 6px; min-height: 26rem; }

.tngwp-arbre-tools { position: absolute; z-index: 20; left: .6rem; bottom: .6rem; display: flex; flex-direction: column; gap: .3rem; }
.tngwp-arbre-wrap .tngwp-arbre-tool { width: 2.4rem; height: 2.4rem; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--tngwp-border); border-radius: 6px; background: var(--tngwp-bg); color: var(--tngwp-fg); font: 700 1.25rem/1 system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); cursor: pointer; }
.tngwp-arbre-wrap .tngwp-arbre-tool:hover { background: #fff; }
.tngwp-arbre-wrap .tngwp-arbre-tool:focus-visible { outline: 3px solid #1a5fb4; outline-offset: 2px; }

/* Plein écran : l'arbre remplit l'écran sous la barre d'outils. */
.tngwp-arbre-wrap:fullscreen { width: 100vw !important; max-width: none !important; margin: 0 !important; padding: .5rem .75rem !important; background: var(--tngwp-bg); display: flex; flex-direction: column; overflow: auto; }
.tngwp-arbre-wrap:fullscreen .tngwp-arbre-stage { flex: 1 1 auto; min-height: 0; }
.tngwp-arbre-wrap:fullscreen .f3.tngwp-arbre { height: 100% !important; }

.tngwp-arbre-evenement-info { margin-top: .15rem; white-space: pre-line; overflow-wrap: anywhere; font-size: .9em; }

/* Noeud technique du couple (ascendance du conjoint) : pas de carte, seulement un trait vertical qui prolonge les liens. */
.tngwp-arbre-wrap .f3 .card:has(.tngwp-card-virtual) {
	pointer-events: none;
}

.tngwp-card-virtual {
	width: 1.5px;
	height: 176px;
	margin: 0 auto;
	background: var(--tngwp-line);
}
