.privolge-family-tree {
	--tree-ink: #22201d;
	--tree-muted: #6d665d;
	--tree-gold: #a47b32;
	--tree-gold-dark: #78571f;
	--tree-paper: #f6f2e9;
	--tree-line: #a99168;
	color: var(--tree-ink);
	margin: 30px 0 38px;
	font-family: inherit;
}

.privolge-family-tree * { box-sizing: border-box; }

.privolge-family-tree__intro {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	padding: 0 2px 18px;
}

.privolge-family-tree__intro h2 {
	font-size: clamp(1.35rem, 3vw, 1.85rem);
	line-height: 1.25;
	margin: 0 0 7px;
}

.privolge-family-tree__intro p,
.privolge-family-tree__footer p {
	color: var(--tree-muted);
	font-size: 14px;
	line-height: 1.5;
	margin: 0;
}

.privolge-family-tree__count {
	background: #eee5d3;
	border: 1px solid #d9c9a9;
	border-radius: 999px;
	color: #684b1b;
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 650;
	padding: 7px 11px;
}

.privolge-family-tree__toolbar {
	align-items: center;
	background: #fff;
	border: 1px solid #ded8cd;
	border-bottom: 0;
	border-radius: 14px 14px 0 0;
	display: flex;
	gap: 10px;
	justify-content: space-between;
	padding: 10px;
	position: relative;
	z-index: 4;
}

.privolge-family-tree__search {
	align-items: center;
	background: #f7f5f1;
	border: 1px solid #d9d4ca;
	border-radius: 9px;
	display: flex;
	flex: 1 1 270px;
	max-width: 360px;
	min-width: 150px;
	padding: 0 11px;
}

.privolge-family-tree__search:focus-within {
	border-color: var(--tree-gold);
	box-shadow: 0 0 0 3px rgba(164, 123, 50, .16);
}

.privolge-family-tree__search svg {
	fill: none;
	flex: 0 0 auto;
	height: 18px;
	stroke: #716b62;
	stroke-linecap: round;
	stroke-width: 1.8;
	width: 18px;
}

.privolge-family-tree__search input {
	appearance: none;
	background: transparent;
	border: 0 !important;
	box-shadow: none !important;
	color: var(--tree-ink);
	font: inherit;
	font-size: 15px;
	height: 42px;
	min-width: 0;
	outline: 0;
	padding: 0 0 0 9px;
	width: 100%;
}

.privolge-family-tree__buttons {
	display: flex;
	flex: 0 0 auto;
	gap: 6px;
}

.privolge-family-tree__buttons button {
	align-items: center;
	background: #f7f5f1;
	border: 1px solid #d9d4ca;
	border-radius: 9px;
	color: #302d29;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 16px;
	font-weight: 650;
	height: 42px;
	justify-content: center;
	line-height: 1;
	min-width: 42px;
	padding: 0 12px;
}

.privolge-family-tree__buttons button:hover {
	background: #eee7db;
	border-color: #c8b68f;
}

.privolge-family-tree__buttons button:focus-visible,
.privolge-family-tree__person a:focus-visible {
	outline: 3px solid rgba(164, 123, 50, .45);
	outline-offset: 2px;
}

.privolge-family-tree__buttons svg {
	fill: none;
	height: 19px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
	width: 19px;
}

.privolge-family-tree__viewport {
	background-color: var(--tree-paper);
	background-image:
		radial-gradient(circle at 10% 20%, rgba(176, 142, 78, .08), transparent 28%),
		radial-gradient(circle at 90% 75%, rgba(118, 91, 47, .07), transparent 31%),
		linear-gradient(rgba(255,255,255,.34) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.34) 1px, transparent 1px);
	background-size: auto, auto, 24px 24px, 24px 24px;
	border: 1px solid #ded8cd;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 12px 34px rgba(59, 43, 22, .08);
	cursor: grab;
	height: min(680px, 76vh);
	min-height: 510px;
	overflow: hidden;
	position: relative;
	touch-action: none;
	user-select: none;
}

.privolge-family-tree__viewport:active { cursor: grabbing; }
.privolge-family-tree__viewport:focus-visible { outline: 3px solid rgba(164, 123, 50, .38); outline-offset: -3px; }

.privolge-family-tree__stage {
	left: 0;
	position: absolute;
	top: 0;
	transform-origin: 0 0;
	will-change: transform;
}

.privolge-family-tree__lines {
	inset: 0;
	overflow: visible;
	pointer-events: none;
	position: absolute;
	width: 100%;
	height: 100%;
}

.privolge-family-tree__lines path {
	fill: none;
	stroke: var(--tree-line);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 3;
	vector-effect: non-scaling-stroke;
}

.privolge-family-tree__person {
	background: rgba(255,255,255,.95);
	border: 1px solid #d9ccb5;
	border-radius: 17px;
	box-shadow: 0 8px 24px rgba(57, 42, 19, .11);
	height: 205px;
	padding: 13px 12px 11px;
	position: absolute;
	text-align: center;
	transform: translateX(-50%);
	transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
	width: 204px;
	z-index: 2;
}

.privolge-family-tree__person > a {
	color: inherit;
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none !important;
}

.privolge-family-tree__person--linked:hover {
	border-color: var(--tree-gold);
	box-shadow: 0 13px 31px rgba(68, 47, 15, .19);
	transform: translateX(-50%) translateY(-3px);
}

.privolge-family-tree__portrait {
	background-image: var(--portrait-image);
	background-position: var(--portrait-x) var(--portrait-y);
	background-repeat: no-repeat;
	background-size: 1428.48px 1587.2px;
	border: 2px solid #ad8339;
	border-radius: 50%;
	box-shadow: 0 0 0 3px #eadbbd, 0 5px 14px rgba(74, 50, 13, .15);
	display: block;
	flex: 0 0 auto;
	height: 96px;
	margin: 0 auto 8px;
	width: 96px;
}

.privolge-family-tree__dates {
	color: var(--tree-gold-dark);
	font-size: 12px;
	font-weight: 750;
	letter-spacing: .02em;
	line-height: 1.2;
	margin-bottom: 3px;
}

.privolge-family-tree__person strong {
	display: -webkit-box;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.22;
	margin: 0 auto;
	max-width: 176px;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.privolge-family-tree__more {
	color: #795a25;
	font-size: 10px;
	font-weight: 650;
	line-height: 1;
	margin-top: auto;
	opacity: .72;
}

.privolge-family-tree__person.is-found {
	animation: privolge-tree-found 1.45s ease;
	border-color: #b27615;
	box-shadow: 0 0 0 7px rgba(196, 141, 39, .2), 0 14px 34px rgba(63, 42, 12, .2);
}

@keyframes privolge-tree-found {
	0%, 100% { transform: translateX(-50%) scale(1); }
	38% { transform: translateX(-50%) scale(1.055); }
}

.privolge-family-tree__hint {
	background: rgba(38, 34, 29, .82);
	border-radius: 999px;
	bottom: 15px;
	color: #fff;
	font-size: 12px;
	left: 50%;
	line-height: 1.25;
	opacity: 1;
	padding: 8px 12px;
	pointer-events: none;
	position: absolute;
	transform: translateX(-50%);
	transition: opacity .3s ease;
	white-space: nowrap;
	z-index: 5;
}

.privolge-family-tree.is-used .privolge-family-tree__hint { opacity: 0; }

.privolge-family-tree__footer {
	align-items: center;
	background: #fff;
	border: 1px solid #ded8cd;
	border-radius: 0 0 14px 14px;
	border-top: 0;
	display: flex;
	gap: 20px;
	justify-content: space-between;
	padding: 14px 16px;
}

.privolge-family-tree__footer p { max-width: 100%; }

.privolge-family-tree:fullscreen {
	background: #f3efe7;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 14px;
}

.privolge-family-tree:fullscreen .privolge-family-tree__intro { display: none; }
.privolge-family-tree:fullscreen .privolge-family-tree__viewport { flex: 1 1 auto; height: auto; min-height: 0; }
.privolge-family-tree:fullscreen .privolge-family-tree__footer { display: none; }

.privolge-family-tree__sr-only {
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute !important;
	white-space: nowrap;
	width: 1px;
}

@media (max-width: 680px) {
	.privolge-family-tree { margin-top: 22px; }
	.privolge-family-tree__intro { align-items: flex-start; }
	.privolge-family-tree__intro p { font-size: 13px; }
	.privolge-family-tree__count { display: none; }
	.privolge-family-tree__toolbar { align-items: stretch; flex-direction: column; }
	.privolge-family-tree__search { max-width: none; }
	.privolge-family-tree__buttons { display: grid; grid-template-columns: 42px 42px 1fr 42px; }
	.privolge-family-tree__buttons button { padding: 0 9px; }
	.privolge-family-tree__viewport { height: min(610px, 70vh); min-height: 460px; }
	.privolge-family-tree__hint { bottom: 11px; font-size: 11px; max-width: calc(100% - 22px); overflow: hidden; text-overflow: ellipsis; }
	.privolge-family-tree__footer { align-items: flex-start; flex-direction: column; gap: 8px; }
	.privolge-family-tree__footer p { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
	.privolge-family-tree__person,
	.privolge-family-tree__hint { transition: none; }
	.privolge-family-tree__person.is-found { animation: none; }
}

