.wikidata-familyTree table {
    border-collapse: separate;
    border-spacing: 0;
}

/* Толщина должна совпадать с толщиной NESW-линий */
.wikidata-familyTree .Q {
	background-color: #f8f8f8;
    border: 1px black solid;
    padding: .1em .25em;
    text-align: center;
}

.wikidata-familyTree-vertical .wikidata-familyTree .Z {
    min-width: 1em;
    height: 1em;
}

.wikidata-familyTree-horizontal .wikidata-familyTree .Z {
    min-width: 1em;
    height: .25em;
}

.wikidata-familyTree-vertical .line {
    position: relative;
    height: 0.5em;
}

.wikidata-familyTree-horizontal .line {
    position: relative;
    min-width: 2em;
}

.wikidata-familyTree-horizontal .NS {
    min-width: .5em;
}

/* Должно быть меньше основного текста .Q */
.wikidata-familyTree .Q .years {
	font-size: 85%;
}

.wikidata-familyTree .line .N {
  background-color: #000; display: inline; position: absolute;
  height: calc(50% + 1px); width: 1px; top: 0; left: 50%;
}
.wikidata-familyTree .line .E {
  background-color: #000; display: inline; position: absolute;
  height: 1px; width: 50%; top: 50%; left: 50%;
}
.wikidata-familyTree .line .S {
  background-color: #000; display: inline; position: absolute;
  height: calc(50% + 1px); width: 1px; top: 50%; left: 50%;
}
.wikidata-familyTree .line .W {
  background-color: #000; display: inline; position: absolute;
  height: 1px; width: calc(50% + 1px); top: 50%; left: 0%;
}

.wikidata-familyTree-decorate-by-generation .gen-4 { background-color: #9fe; }
.wikidata-familyTree-decorate-by-generation .gen-3 { background-color: #bfc; }
.wikidata-familyTree-decorate-by-generation .gen-2 { background-color: #ffc; }
.wikidata-familyTree-decorate-by-generation .gen-1 { background-color: #fb9; }
.wikidata-familyTree-decorate-by-generation  .gen0 { background-color: #fcc; }
.wikidata-familyTree-decorate-by-generation  .gen1 { background-color: #fb9; }
.wikidata-familyTree-decorate-by-generation  .gen2 { background-color: #ffc; }
.wikidata-familyTree-decorate-by-generation  .gen3 { background-color: #bfc; }
.wikidata-familyTree-decorate-by-generation  .gen4 { background-color: #9fe; }