/* Flexible Organization Chart public styles. Every selector is scoped or prefixed. */
.foc-chart-wrapper {
	--foc-max-width: 1400px;
	--foc-h-gap: 24px;
	--foc-v-gap: 48px;
	--foc-line-color: #64748b;
	--foc-line-width: 2px;
	--foc-line-style: solid;
	--foc-radius: 8px;
	--foc-zoom: 1;
	box-sizing: border-box;
	clear: both;
	font: inherit;
	line-height: 1.4;
	max-width: var(--foc-max-width);
	position: relative;
	width: 100%;
}
.foc-chart-wrapper *, .foc-chart-wrapper *::before, .foc-chart-wrapper *::after { box-sizing: border-box; }
.foc-align-center { margin-inline: auto; }
.foc-align-left { margin-right: auto; }
.foc-align-right { margin-left: auto; }
.foc-screen-reader-text {
	border: 0 !important;
	clip: rect(1px, 1px, 1px, 1px) !important;
	clip-path: inset(50%) !important;
	height: 1px !important;
	margin: -1px !important;
	overflow: hidden !important;
	padding: 0 !important;
	position: absolute !important;
	width: 1px !important;
	word-wrap: normal !important;
}
.foc-toolbar {
	align-items: end;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-block: 0 14px;
}
.foc-toolbar .foc-search-label { flex-basis: 100%; font-size: .875rem; font-weight: 600; }
.foc-toolbar .foc-search { background: #fff; border: 1px solid #64748b; border-radius: 4px; color: #111827; min-height: 38px; min-width: min(320px, 100%); padding: 6px 10px; }
.foc-toolbar button {
	background: #fff;
	border: 1px solid #64748b;
	border-radius: 4px;
	color: #111827;
	cursor: pointer;
	font: inherit;
	min-height: 38px;
	padding: 6px 12px;
}
.foc-toolbar button:hover { background: #f1f5f9; }
.foc-toolbar button:focus-visible, .foc-search:focus-visible, .foc-node:focus-visible, .foc-branch-toggle:focus-visible, .foc-node a:focus-visible {
	outline: 3px solid #2563eb;
	outline-offset: 3px;
}
.foc-viewport {
	max-width: 100%;
	overflow: auto;
	overscroll-behavior-x: contain;
	overscroll-behavior-y: auto;
	padding: 18px;
	position: relative;
	-webkit-overflow-scrolling: touch;
}
.foc-chart-wrapper[data-foc-pan="1"] .foc-viewport { cursor: grab; }
.foc-chart-wrapper[data-foc-pan="1"] .foc-viewport.foc-is-panning { cursor: grabbing; user-select: none; }
.foc-canvas {
	display: inline-block;
	min-width: max-content;
	position: relative;
	transform: scale(var(--foc-effective-zoom, var(--foc-zoom)));
	transform-origin: top left;
	transition: transform .18s ease;
}
.foc-shared-links {
	height: 100%;
	left: 0;
	overflow: visible;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 100%;
	z-index: 0;
}
.foc-shared-link {
	fill: none;
	stroke: #7c3aed;
	stroke-dasharray: 7 5;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: max(2px, var(--foc-line-width));
	vector-effect: non-scaling-stroke;
}

/* Floor layout: horizontal sections connected to one central vertical branch. */
.foc-section-chart {
	min-width: min(1120px, var(--foc-max-width));
	position: relative;
}
.foc-section-row {
	align-items: center;
	display: grid;
	grid-template-columns: minmax(260px, 1fr) 52px minmax(260px, 1fr);
	min-height: var(--foc-section-height, 140px);
	padding: 20px 0;
	position: relative;
}
.foc-section-label {
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	color: #475569;
	font-size: .68rem;
	font-weight: 700;
	left: 6px;
	letter-spacing: .04em;
	padding: 3px 8px;
	position: absolute;
	top: 5px;
	z-index: 2;
}
body:not(.wp-admin) .foc-chart-wrapper .foc-section-label { display: none; }
.foc-section-side {
	align-items: center;
	display: flex;
	gap: var(--foc-h-gap);
	min-width: 0;
	position: relative;
	z-index: 1;
}
.foc-section-side--left { grid-column: 1; justify-content: flex-end; }
.foc-section-side--center { grid-column: 2; justify-content: center; }
.foc-section-side--right { grid-column: 3; justify-content: flex-start; }
.foc-section-card { flex: 0 0 auto; position: relative; top: var(--foc-section-y-offset, 0); }
.foc-section-card--left { right: var(--foc-section-offset, 0); }
.foc-section-card--right { left: var(--foc-section-offset, 0); }
.foc-section-links {
	height: 100%;
	left: 0;
	overflow: visible;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 100%;
	z-index: 0;
}
.foc-section-link {
	fill: none;
	stroke: var(--foc-line-color);
	stroke-dasharray: none;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: var(--foc-line-width);
	vector-effect: non-scaling-stroke;
}
.foc-line-style-dashed .foc-section-link { stroke-dasharray: 8 6; }
.foc-line-style-dotted .foc-section-link { stroke-dasharray: 2 5; }
.foc-tree {
	display: flex;
	justify-content: center;
	list-style: none !important;
	margin: 0 !important;
	padding: calc(var(--foc-v-gap) / 2) 0 0 !important;
	position: relative;
}
.foc-tree--root { padding-top: 0 !important; }
.foc-tree-item {
	align-items: center;
	display: flex;
	flex-direction: column;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 calc(var(--foc-h-gap) / 2) !important;
	position: relative;
	text-align: center;
}
.foc-tree--children > .foc-tree-item {
	padding: calc(var(--foc-v-gap) / 2) calc(var(--foc-h-gap) / 2) 0 !important;
}
.foc-tree--children::before {
	border-left: var(--foc-line-width) var(--foc-line-style) var(--foc-line-color);
	content: "";
	height: calc(var(--foc-v-gap) / 2);
	left: 50%;
	position: absolute;
	top: 0;
}
.foc-tree--children > .foc-tree-item::before,
.foc-tree--children > .foc-tree-item::after {
	border-top: var(--foc-line-width) var(--foc-line-style) var(--foc-line-color);
	content: "";
	height: calc(var(--foc-v-gap) / 2);
	position: absolute;
	right: 50%;
	top: 0;
	width: 50%;
}
.foc-tree--children > .foc-tree-item::after {
	border-left: var(--foc-line-width) var(--foc-line-style) var(--foc-line-color);
	left: 50%;
	right: auto;
}
.foc-tree--children > .foc-tree-item:first-child::before,
.foc-tree--children > .foc-tree-item:last-child::after { border-top-color: transparent; }
.foc-tree--children > .foc-tree-item:only-child::before,
.foc-tree--children > .foc-tree-item:only-child::after { border-top: 0; }
.foc-tree--children > .foc-tree-item:only-child::before { display: none; }
.foc-connection-hidden::before, .foc-connection-hidden::after { border-color: transparent !important; }
.foc-lines-rounded .foc-tree--children > .foc-tree-item::before,
.foc-lines-rounded .foc-tree--children > .foc-tree-item::after { border-radius: 0; }
.foc-lines-straight .foc-tree--children > .foc-tree-item::before,
.foc-lines-straight .foc-tree--children > .foc-tree-item::after { width: 0; }
.foc-node-wrap { align-items: center; display: flex; flex-direction: column; position: relative; }
.foc-node {
	--foc-node-width: 240px;
	background: #fff;
	border: 1px solid #64748b;
	border-radius: var(--foc-radius);
	color: #111827;
	display: flex;
	flex-direction: column;
	justify-content: center;
	max-width: var(--foc-node-width);
	overflow-wrap: anywhere;
	padding: 16px;
	position: relative;
	width: var(--foc-node-width);
	z-index: 1;
}
.foc-has-shadow .foc-node { box-shadow: 0 4px 14px rgba(15, 23, 42, .14); }
.foc-node-title { font-size: 1rem; font-weight: 700; line-height: 1.25; }
.foc-node-name { font-size: .95rem; margin-top: 5px; }
.foc-node-email, .foc-node-phone, .foc-node-link { color: inherit; display: inline-block; font-size: .875rem; margin-top: 6px; text-decoration: underline; }
.foc-node-description { font-size: .82rem; line-height: 1.45; margin-top: 8px; }
.foc-node-description > :first-child { margin-top: 0; }
.foc-node-description > :last-child { margin-bottom: 0; }
.foc-shared-badge {
	align-items: center;
	align-self: center;
	background: #f3e8ff;
	border: 1px solid #c4b5fd;
	border-radius: 999px;
	color: #5b21b6;
	display: inline-flex;
	font-size: .7rem;
	font-weight: 700;
	gap: 3px;
	line-height: 1.2;
	margin-top: 9px;
	padding: 3px 7px;
}
.foc-node-photo { border-radius: 50%; display: block; height: 64px; margin: 0 auto 10px; object-fit: cover; width: 64px; }
.foc-node-icon { display: block; font-size: 1rem; margin-bottom: 6px; }
.foc-node--vacant { border-style: dashed; }
.foc-node--vacant::after { content: attr(data-foc-vacant); }
.foc-branch-toggle {
	align-items: center;
	background: #fff;
	border: 1px solid #64748b;
	border-radius: 50%;
	color: #111827;
	cursor: pointer;
	display: flex;
	font: 700 16px/1 sans-serif;
	height: 28px;
	justify-content: center;
	margin-top: 7px;
	padding: 0;
	width: 28px;
	z-index: 2;
}
.foc-tree[hidden], .foc-tree-item[hidden] { display: none !important; }
.foc-node.foc-search-match { box-shadow: 0 0 0 4px #f59e0b, 0 4px 14px rgba(15, 23, 42, .14); }
.foc-node.foc-search-dim { opacity: .35; }
.foc-admin-preview-notice, .foc-notice { border-left: 4px solid #2563eb; background: #eff6ff; color: #111827; margin: 10px 0; padding: 10px 14px; }
.foc-notice--error { border-left-color: #b91c1c; background: #fef2f2; }
.foc-notice--empty { border-left-color: #64748b; background: #f8fafc; }

/* Horizontal tree: cards flow left-to-right, children stack vertically. */
.foc-orientation-horizontal .foc-tree { align-items: flex-start; flex-direction: column; justify-content: flex-start; padding: 0 0 0 var(--foc-v-gap) !important; }
.foc-orientation-horizontal .foc-tree--root { padding-left: 0 !important; }
.foc-orientation-horizontal .foc-tree-item { align-items: center; flex-direction: row; padding: calc(var(--foc-h-gap) / 2) 0 !important; }
.foc-orientation-horizontal .foc-tree--children { margin-left: 0 !important; }
.foc-orientation-horizontal .foc-tree--children::before { border-left: var(--foc-line-width) var(--foc-line-style) var(--foc-line-color); height: 100%; left: 0; top: 0; }
.foc-orientation-horizontal .foc-tree--children > .foc-tree-item::before { border-left: 0; border-top: var(--foc-line-width) var(--foc-line-style) var(--foc-line-color); height: 0; left: 0; right: auto; top: 50%; width: var(--foc-v-gap); }
.foc-orientation-horizontal .foc-tree--children > .foc-tree-item::after { display: none; }
.foc-orientation-horizontal .foc-node-wrap { flex-direction: row; }
.foc-orientation-horizontal .foc-branch-toggle { margin: 0 0 0 7px; }

/* Templates are neutral starting points; node-level and saved styles override them. */
.foc-template-modern .foc-node { border-width: 0 0 4px; border-radius: 4px; }
.foc-template-minimal .foc-node { background: transparent; border-width: 0 0 1px; box-shadow: none; }
.foc-template-cards .foc-node { border: 0; box-shadow: 0 7px 22px rgba(15, 23, 42, .16); }
.foc-template-compact { --foc-h-gap: max(8px, var(--foc-h-gap)); --foc-v-gap: max(28px, var(--foc-v-gap)); }
.foc-template-compact .foc-node { font-size: .86rem; min-height: 54px !important; padding: 9px; }
.foc-template-administrative .foc-node { border-width: 2px; border-radius: 0; }
.foc-template-horizontal .foc-node { border-radius: 999px; }
.foc-template-vertical .foc-node { border-left-width: 5px; }

@media (max-width: 1024px) and (min-width: 768px) {
	.foc-chart-wrapper .foc-node { font-size: .9em; }
	.foc-chart-wrapper .foc-viewport { padding: 12px; }
}

@media (max-width: 767px) {
	.foc-chart-wrapper { max-width: 100%; }
	.foc-chart-wrapper .foc-toolbar { align-items: stretch; }
	.foc-chart-wrapper .foc-toolbar .foc-search { flex: 1 1 100%; min-width: 0; }
	.foc-chart-wrapper:not(.foc-mobile-scroll) .foc-viewport { overflow: visible; padding: 8px 0; }
	.foc-chart-wrapper:not(.foc-mobile-scroll) .foc-canvas { display: block; min-width: 0; transform: none !important; }
	.foc-chart-wrapper:not(.foc-mobile-scroll) .foc-shared-links { display: none; }
	.foc-chart-wrapper:not(.foc-mobile-scroll) .foc-section-chart { min-width: 0; width: 100%; }
	.foc-chart-wrapper:not(.foc-mobile-scroll) .foc-section-links { display: none; }
	.foc-chart-wrapper:not(.foc-mobile-scroll) .foc-section-row { display: block; min-height: 0 !important; padding: 38px 0 10px; }
	.foc-chart-wrapper:not(.foc-mobile-scroll) .foc-section-side { align-items: stretch; display: flex; flex-direction: column; gap: 10px; }
	.foc-chart-wrapper:not(.foc-mobile-scroll) .foc-section-card { left: auto; margin: 0; right: auto; top: auto; transform: none; }
	.foc-chart-wrapper:not(.foc-mobile-scroll) .foc-section-card .foc-node { max-width: 100%; width: min(100%, var(--foc-mobile-width)); }
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-tree,
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked).foc-orientation-horizontal .foc-tree {
		display: block;
		padding: 0 0 0 18px !important;
		width: 100%;
	}
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-tree--root { padding-left: 0 !important; }
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-tree-item,
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked).foc-orientation-horizontal .foc-tree-item {
		display: block;
		padding: 5px 0 !important;
		text-align: left;
	}
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-node-wrap { align-items: flex-start; display: flex; flex-direction: row; gap: 6px; }
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-node { max-width: 100%; text-align: left; width: min(100%, var(--foc-mobile-width)); }
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-branch-toggle { flex: 0 0 28px; margin: 8px 0 0; }
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-tree--children::before { border-left: var(--foc-line-width) var(--foc-line-style) var(--foc-line-color); height: 100%; left: 5px; top: 0; }
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-tree--children > .foc-tree-item::before { border-left: 0; border-top: var(--foc-line-width) var(--foc-line-style) var(--foc-line-color); height: 0; left: -13px; right: auto; top: 28px; width: 13px; }
	.foc-chart-wrapper:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-tree--children > .foc-tree-item::after { display: none; }
	.foc-mobile-stacked .foc-tree { padding-left: 0 !important; }
	.foc-mobile-stacked .foc-node { width: 100% !important; }
	.foc-mobile-reduced .foc-canvas { --foc-effective-zoom: .72; }
	.foc-mobile-lines-hidden .foc-tree::before, .foc-mobile-lines-hidden .foc-tree-item::before, .foc-mobile-lines-hidden .foc-tree-item::after { display: none !important; }
	.foc-mobile-lines-hidden:is(.foc-mobile-accordion, .foc-mobile-list, .foc-mobile-stacked) .foc-tree { padding-left: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
	.foc-chart-wrapper *, .foc-chart-wrapper *::before, .foc-chart-wrapper *::after { animation-duration: .001ms !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}

@media print {
	@page { size: landscape; margin: 10mm; }
	.foc-chart-wrapper { background: #fff !important; color: #000 !important; max-width: none !important; width: 100% !important; }
	.foc-chart-wrapper .foc-toolbar, .foc-chart-wrapper .foc-branch-toggle, .foc-chart-wrapper .foc-admin-preview-notice { display: none !important; }
	.foc-chart-wrapper .foc-viewport { overflow: visible !important; padding: 0 !important; }
	.foc-chart-wrapper .foc-canvas { margin: 0 !important; min-width: max-content; transform: none !important; }
	.foc-chart-wrapper .foc-tree[hidden] { display: flex !important; }
	.foc-chart-wrapper .foc-node { background: #fff !important; box-shadow: none !important; break-inside: avoid; color: #000 !important; page-break-inside: avoid; }
}
