:root {
	--bg_color_l: #fbffe0;
	--bg_color_d: #222;
	--text_d: #e0e0e0;
}

* {
	margin: 0;
	padding: 0;
}
body {
	background-color: var(--bg_color_l);
}

nav {
	background-color: #fff;
	border-top: 2px solid #000;
	border-bottom: 2px solid #000;
	text-align: center;
	font-size: 1em;
}

footer {
	background-color: #fff;
	text-align: center;
	font-size: .9em;
	border-top: 2px solid #000;
	border-bottom: 2px solid #000;
	padding: .5em 0 .5em 0;
	clear: both;
	margin-top: 5px;
}

table {
	background-color: #fff;
	border: 1px solid black;
	border-collapse: collapse;
}

td {
	padding: 1px 3px;
}

th {
	background-color: #ffffce;
	padding: 1px 3px;
	font-weight: bold;
}
a {
	color: #000;
}
a:focus {
/*
	font-weight: bold;
*/
	outline: 0;
	color: #668800;
}
.links a {
	display: block;
	padding: 0 5px;
}

img {
	background-color: #fff;
}

figure {
	background-color: #fff;
	border: 2px solid #892b13;
	width: min-content;
	margin-bottom: 3px;
	margin-top: .7em;
}
figcaption {
	background-color: #fff;
	text-align: center;
	font-style: italic;
}
figcaption .non_it {
	font-style: normal;
}

h1 {
	padding: .5em;
	text-align: center;
	font-style: italic;
}
h2 {
	padding: .5em 0;
	clear: both;
}
h3 {
	padding: .5em 0;
/*
	clear: left;
*/
}

h4 {
	font-size: 1.3em;
	padding: .5em 0;
}

/* формулы */
span.formula {
	white-space: nowrap;
}
.formula {
	white-space: nowrap;
}

table.bg_standart {
	border: 0;
}
.bg_standart {
	background-color: var(--bg_color_l);
}
.bg_standart td, .bg_standart th {
	background-color: var(--bg_color_l);
}

.block {
	display: inline-block;
	vertical-align: top;
}
.cols {
	margin-right: 90px;
}
.cols1 {
	width: 19%;
}
.table_center {
	margin: auto;
}
.float_l {
	float: left;
	margin-right: 10px;
}
.float_r {
	float: right;
	margin-left: 10px;
}
.non_float {
	clear: both;
}
.yellow {
	background-color: #ffff55;
}
.yellow1 {
	background-color: #ffffaa;
}
.green {
	background-color: #ddff00;
}
.want {
	background-color: #ffa;
}
.green_text {
	color: #aadd00;
}
.red_text {
	color: #f00;
}
.center {
	text-align: center;
}
.top {
	vertical-align: top;
}
.width1 {
	width: 45px;
}
.width2 {
	width: 70px;
}
.width3 {
	width: 57px;
}
.bold {
	font-weight: bold;
}
.ital {
	font-style: italic;
}
.right {
	text-align: right;
}
.left {
	text-align: left;
}
.small_quadr_sell td {
	height: 1.2em;
	width: 1.2em;
	padding: 1px;
}
.no_wrap {
	white-space: nowrap;
}

/* Отступы: */
.tab1 {
	margin-left: 3em;
}
.tab2 {
	margin-left: 6em;
}
.tab3 {
	margin-left: 9em;
}
.tab4 {
	margin-left: 12em;
}
.tab5 {
	margin-left: 15em;
}
.tab6 {
	margin-left: 18em;
}

.vert_text_table {
	writing-mode: vertical-rl;
	width: 1.1em;
}

/* автоматическая нумерация строк таблицы */

.countLines {
	counter-reset: trCount;
}
.countLines tr td:first-child:before {
	position:relative;
	counter-increment: trCount;
	content:counter(trCount);
}

.countLines1 {
	counter-reset: trCount;
}
.countLines1 tr td:last-child:after {
	position:relative;
	counter-increment: trCount;
	content:counter(trCount);
}

/* шапка таблицы видна постоянно при прокручивании */

.table_wrapper {
	overflow-y: scroll;
	flex-grow: 1;
}

.table_wrapper thead {
	position: sticky;
	top: 0;
}

.table_wrapper tr, .table_wrapper th {
	border: 1px solid #000;
}

/*
.table_wrapper thead {
	position: fixed;
	top: 0;
	display: block;
	width: 100%;
}
*/

/* отображение контейнеров в виде таблицы */
.divtable {
	display: table;
}
.divtr {
	display: table-row;
}
.divtd {
	display: table-cell;
	vertical-align: middle;
}

#toc {
	background-color: #fff;
	border: 2px solid #892b13;
	border-radius: 20px;
	padding: 5px 40px 10px 40px;
}
#content {
	padding: 0 2% 1% 2%;
/*
	display: flex;
	flex-direction: column;
*/
}
#up {
	background-color: #fff;
	z-index: 1;
	position: fixed;
	bottom: 10px;
	right: 20px;
}
#up a:focus {
	font-weight: normal;
}

#mobi_menu_content {
	display: none;
}
.category {
	display: inline-block;
	padding: 1em 27px;
}
.links {
	background-color: #fff;
	border-left: 2px solid #000;
	border-bottom: 2px solid #000;
	border-right: 2px solid #000;
	display: none;
	margin: 1em 0 0 -30px;
	text-align: left;
	padding-bottom: 5px;
	z-index: 1;
	width: 14em;
}
.category:hover .links {
	display: block;
	position: absolute;
}
.links a:hover {
	background-color: #efefd7;
}

/* Базовые стили слоя затемнения и модального окна  */
.overlay {
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 10;
	display: none;
	background-color: rgba(0, 0, 0, 0.5);
	position: fixed;
}
/* активируем слой затемнения */
.overlay:target {
	display: block;
}
/* стили модального окна */
.popup {
	display: none;
	z-index: 20;
	margin: 0;	
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 15px;
	background: #fefede;
	width: 500px;
	text-align: center;
	border-radius: 7px;
	/* внешняя тень */
	box-shadow: 0 15px 20px rgba(0,0,0,.22),0 19px 60px rgba(0,0,0,.3);
}
/* активируем модальный блок */
.overlay:target+.popup {
	/* фиксированное позиционирование, окно стабильно при прокрутке */
	position: fixed;
	top: 50%;
	right: 50%;
	left: 50%;
	display: block;
}
/* формируем кнопку закрытия */
.close {
	top: -11px;
	right: -12px;
	width: 20px;
	height: 20px;
	position: absolute;
	padding: 0;
	border: 2px solid #ffffde;
	border-radius: 15px;
	background-color: rgba(61, 61, 61, 0.8);
	box-shadow: 0px 0px 10px #000;
	text-align: center;
	text-decoration: none;
	font-weight: bold;
}
.close:before {
	color: rgba(255, 255, 222, 0.9);
	content: "×";
	text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
	font-size: 12px;
}
.close:hover {
	background-color: rgba(137, 43, 19, 0.8);
}
.descrip {
	margin: auto;
}
.descrip td {
	padding-right: 4px;
	padding-left: 4px;
}
.descrip td:first-child {
	text-align: right;
}
.help {
	margin: auto;
	border: 1px solid black;
}

@media (prefers-color-scheme: dark) {
	body {
		background-color: var(--bg_color_d);
		color: #e0e0e0;
	}
	a {
		color: #e0e0e0;
	}
	nav, footer {
		background-color: #111;
	}
	img, figure {
		background-color: #bbb;
	}
	figcaption {
		background-color: var(--bg_color_d);
	}
	#toc, #up {
		background-color: var(--bg_color_d);
	}
	table {
		background-color: #333;
	}
	th {
		background-color: #3d3d3d;
	}
	.links {
		background-color: #3d3d3d;
	}
	.links a:hover {
		background-color: #111;
	}
	
	.matrix {
		border-left: 2px solid var(--text_d);
		border-right: 2px solid var(--text_d);
	}
	.matrix table {
		background-color: var(--bg_color_d);
	}
	.frac {
		background-color: var(--bg_color_d);
	}
	table.def {
		background-color: var(--bg_color_d);
	}
	.lf {
		border-left: 1.5px solid var(--text_d);
	}
	.rg {
		border-right: 1.5px solid var(--text_d);
	}
	.bor_top {
		border-top: 1px solid var(--text_d);
	}
	.bor_bot {
		border-bottom: 1px solid var(--text_d);
	}
	.bg_standart td, .bg_standart th {
		background-color: var(--bg_color_d);
	}
	.bg_standart {
		background-color: var(--bg_color_d);
	}
}
