.org-chart {
  --org-chart-wire: color-mix(in srgb,var(--muted) 55%,var(--line));
  --org-chart-wire-height: 15px;
  --org-chart-gutter: clamp(7px,1.05vw,14px);
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--sidebar);
  padding: 18px 15px 24px;
}
.org-chart-tree,
.org-chart-children,
.org-chart-people {
  margin: 0;
  padding: 0;
  list-style: none;
}
.org-chart-tree {
  display: flex;
  justify-content: center;
  width: max-content;
  min-width: 100%;
}
.org-chart-branch {
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.org-chart-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.org-chart-card {
  width: clamp(132px,16vw,185px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}
.org-chart-selected,
.org-chart-match {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.org-chart .org-chart-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--soft);
  color: var(--brand-text);
  padding: 7px 9px;
  text-align: left;
  overflow-wrap: anywhere;
  font-weight: 700;
}
.org-chart .org-chart-title:hover { background: var(--hover); }
.org-chart-card:has(.org-chart-people) .org-chart-title { border-radius: 6px 6px 0 0; }
.org-chart-count {
  color: var(--muted);
  flex: none;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  padding-top: 1px;
}
.org-chart-people { padding: 3px; }
.org-chart .org-chart-person-button {
  display: block;
  width: 100%;
  padding: 5px 6px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.org-chart .org-chart-person-button:hover { background: var(--hover); }
.org-chart-person-title {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.org-chart .org-chart-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 25px;
  padding: 0;
  margin: 6px 0 0;
  color: var(--brand-text);
  line-height: 1;
  font-size: 16px;
  z-index: 1;
}
.org-chart-children {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding-top: var(--org-chart-wire-height);
}
.org-chart-children::before {
  content: '';
  position: absolute;
  top: 0;
  height: var(--org-chart-wire-height);
  left: 50%;
  border-left: 1px solid var(--org-chart-wire);
}
.org-chart-children > .org-chart-branch {
  padding: var(--org-chart-wire-height) var(--org-chart-gutter) 0;
}
.org-chart-children > .org-chart-branch::before,
.org-chart-children > .org-chart-branch::after {
  content: '';
  position: absolute;
  top: 0;
  height: var(--org-chart-wire-height);
  width: 50%;
  border-top: 1px solid var(--org-chart-wire);
  pointer-events: none;
}
.org-chart-children > .org-chart-branch::before { right: 50%; }
.org-chart-children > .org-chart-branch::after { left: 50%; border-left: 1px solid var(--org-chart-wire); }
.org-chart-children > .org-chart-branch:first-child::before,
.org-chart-children > .org-chart-branch:last-child::after { border-top: 0; }
