body {
	color: #444;
	font-size: 18px;
	line-height: 1.5;
	margin: 40px auto;
	max-width: 850px;
	padding: 0 10px;
}

pre {
	background: #eee;
	padding: 0.2em 5px;
	overflow: scroll;
}

div {
	background: #f0f0f0;
	padding: 0.2em 5px;
	overflow: scroll;
}

blockquote {
	background: #f7f7f7;
	margin: 1.5em 10px;
	padding: 0.5em 10px;
}

table {
	width: 850px;
	border: solid 1px #000000;
	border-collapse: collapse;
	position: relative;
	font-size: 14px;
}

td {
	line-height: 1.6;
	padding: 0em 8px;
	border: solid 1px #000000;
}

img {
	display: block;
	position: relative; /* Position relative to allow left 50% to work */
	left: 50%; /* Set left edge of image to the middle of the container */
	transform: translateX(-50%); /* Pull back to the left half the width of the image */
}

video {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.hanchor {
	color: #222;
	text-decoration: none;
}

.toc {
	background: #f8f8f8;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 15px 25px;
	margin: 20px 0;
	max-width: 100%;
	font-size: 14px;
	overflow-x: auto;
	box-sizing: border-box;
	width: auto;
}

.toc-title {
	font-weight: bold;
	font-size: 1.1em;
	margin-bottom: 10px;
	color: #333;
	overflow: visible;
}

.toc ul {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

.toc li {
	margin: 2px 0;
	line-height: 1.4;
}

.toc a {
	text-decoration: none;
	color: #444;
}

.toc a:hover {
	text-decoration: underline;
	color: #000;
}

/* Remove automatic list-style numbering */
.toc li {
	list-style: none;
}

/* Add numbering as pseudo-elements */
.toc li {
	position: relative;
	padding-left: 4em;  /* Space for numbers */
}

.toc > ul > li {
	counter-increment: h1;  /* Add this for first level */
}

.toc > ul > li::before {
	content: counter(h1) ". ";  /* Add this for first level */
	position: absolute;
	left: 0;
	color: #666;
}

/* Reset counter for first level */
.toc > ul {
	counter-reset: h1;  /* Add this */
}

.toc > ul > li > ul > li {
	counter-increment: h2;
}

.toc > ul > li > ul > li > ul > li {
	counter-increment: h3;
}

.toc > ul > li > ul > li::before {
	content: counter(h2) ". ";
	position: absolute;
	left: 0;
	color: #666;
}

/* Second level numbering */
.toc > ul > li > ul > li::before {
    content: counter(h1) "." counter(h2) " ";
    position: absolute;
    left: 0;
    color: #666;
}

/* Third level numbering */
.toc > ul > li > ul > li > ul > li::before {
    content: counter(h1) "." counter(h2) "." counter(h3) " ";
    position: absolute;
    left: 0;
    color: #666;
}

/* Fourth level numbering */
.toc > ul > li > ul > li > ul > li > ul > li::before {
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) " ";
    position: absolute;
    left: 0;
    color: #666;
}

.toc > ul > li > ul > li > ul > li > ul > li {
	counter-increment: h4;
}

.toc > ul > li > ul > li > ul > li > ul > li > ul >li {
	counter-increment: h5;
}

/* Reset counters at each level */
.toc > ul {
	counter-reset: h2;
}

.toc > ul > li > ul {
	counter-reset: h3;
}

.toc > ul > li > ul > li > ul {
	counter-reset: h4;
}

.toc > ul > li > ul > li > ul >li > ul {
	counter-reset: h4;
}

/* Hide empty items */
.toc li:empty {
	display: none;
}
