button, input, textarea, select {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

#logo{
width			: 100%;
padding-bottom: 2px;
border-bottom : 2px solid #4444AA;
margin-bottom : 12px;
}
#logo A.logo{
font  : bold 32px cursive;
color	: red; 
}
#logo A,#footer A{
text-decoration: none;
}
#left{
vertical-align:top;
width: 200px;
margin-right:12px;
}
#right{
vertical-align:top;
padding: 8px;
padding-top:0;
}
#footer{
width      :100%;
padding-top:4px;
border-top :2px solid #4444AA;
text-align :center;
clear      :both;
line-height: 20px;
}
#resdiv{
text-align: left;
vertical-align: middle;
margin-left: 8px;
margin-right: 8px;
border: 0;
font-family: cursive;

overflow-y:hidden;
position:relative;
}
.menu{
width		   : 100%;
margin-bottom: 12px;
}
.menu A,.menu H1, .menu B{
margin:0;
padding: 4px;
display: block;
text-align: left;
text-decoration: none;
border: 1px solid #aaa;
border-bottom: 0px solid #aaa;
background-color: #eee;
font-size: 100%;
}
.menu A:hover{
background-color: #ffe;
}
.menu H1, .menu B{
text-align : center;
font-weight: bold;
color      : black;
background-color: #ddd;
}
.menu A:last-child {
  border-bottom-width: 1px;
}
.box {
width: 100%;
margin:0;
margin-bottom:12px;
border: 1px solid #aaa;
background-color: #eee;
}
.line{
clear:none;
width:100%;
border-bottom: 2px solid #4444AA;
font-size : medium;
color : #323299;
padding-left: 8px;
padding-right: 8px;
}
.line .right{
text-align:right;
}

.bbox BUTTON,.bbox INPUT,.bbox2 BUTTON,.bbox2 INPUT,.bbox2 SELECT, .bbox INPUT,.bbox2 INPUT {
  height: 24px;
  vertical-align: bottom;
}
.bbox BUTTON{
  width: 200px;
}
.bbox BUTTON.sh{
  width: 166px;
}
.bbox INPUT.dig{
  width: 30px;
}
.bbox2 BUTTON{
  width: 118px;
}
.bbox2 INPUT,.bbox2 BUTTON.sh{
  width:40px;
  margin-left: 4px;
}
.bbox2 SELECT{
  width:50px;
}
A               {color: #4444AA;}
A:HOVER {color: #006666;}
HR{
border: 1px solid #4444AA;
}
.insertButtons BUTTON{
  width		: 110px;
  height	: 24px;
  vertical-align: bottom;
}
.actline {
text-align: left;
border-top:1px solid #999999;
padding-bottom: 16px;
padding-top   : 6px;
clear:right;
}
.smbutton {
width: auto;
font-family: monospace;
color: #007700;
font-weight: bold;
font-size: 16px;
height: 24px;
}
.changeButton {
  height: auto;
}

H2 { font-size : medium; color : #323299; text-align: center; }

H4, H5 { font-size: small; padding-left: 8px; padding-right: 8px; }
H6 { font-size: small; padding: 0; margin: 0; }
P  {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
text-align: justify; text-indent: 24px; padding-left: 8px; padding-right: 8px; }
STRONG { color: #CC3333; }
TABLE.actions TD { vertical-align: bottom; height: 24px; }
BUTTON {
vertical-align: bottom;
height: 24px;
}
TABLE.main{
width:100%;
border-spacing: 0;
border:0;
text-align:center;
empty-cells:show;
}
TABLE.main TD{
vertical-align: middle;
text-align: center;
border:0;
padding:2px;
margin:0;
}
TABLE.main TD.tdmatrix{
width:46%;
}
SPAN.top {
vertical-align: top;
}
TABLE.ButtonSet {
border: 0px;
}
/* ---------- */
TABLE.rtable {
border: 0px;
color: #3B3179;
font-size: small;
font-family: cursive;  
text-align: left;
vertical-align: middle;
text-indent: 0px;
width: 98%;
}
TABLE.rtable TD {
border: 0px;
}
TABLE.rtable TD.right {
text-align: right;
width: 194px;
}
TABLE.rtable TD.right1 {
text-align: right;
width: 183px;
}
SELECT.bigsel {
font-family: monospace;
font-size: medium;
height: 34px;
}
/* ------------------------------------------- */
/* fraction */
TABLE.fraction {
  font-family: cursive;
  
  display: inline-table;
  
  text-align: center;
  vertical-align: middle;
  padding: 0 1px 0 1px;
  margin: 0;
  text-indent: 0;
  border: 0;
  border-collapse:separate;
  border-spacing: 0px;
  font-size: 80%;
}
TABLE.fraction TD {
  border: 0;
  padding: 0;
  margin: 0;
}
TABLE.fraction TD.fr {
  border-bottom: 1px solid #3B3179;
}
/*
*TABLE.fraction{
display: inline;
}
*/
/* fraction */
/* matrix */
TABLE.inTable {
  display: inline-table;

  height: 1px;
  font-family: cursive;
  border: 0;
  text-indent: 0;
  vertical-align:middle;
  text-align:center;
  border-spacing:0;
  empty-cells:show;
  border-collapse: separate;

  margin:2px;
}
TABLE.inTable TR{
  height: 1px;
}
TABLE.inTable TD{
  vertical-align: middle;
  text-align:right;
  border: 0;
  padding: 1px 5px 1px 5px;
}
TABLE.inTable TD.img {
  padding:0;
  margin:0;
  border:0;
}


TABLE.matrix {
  font-family: cursive;
  border: 0;
  text-indent: 0;
  border-spacing:0;
  border-collapse: separate;
  margin-left:auto;
  margin-right:auto;
  empty-cells:show;
  
  white-space: nowrap;
}
TABLE.matrix TR{
  height: 1px;
}
TABLE.matrix TD {
  vertical-align: middle;
  padding: 0;
  border : 0;
  line-height: 0;
}
TABLE.matrix input {
  margin: 1px;
  text-align: right;
  max-width: 4em;
  min-width: 4em;
  width: 100em;
}

.tdmatrix textarea {
  white-space: pre;
  word-wrap: normal;
  overflow: auto;
}

TABLE.matrix input.invalid,
.tdmatrix textarea.invalid {
  border: 1px solid red;
  background-color: #fee;
}

/* matrix */
TABLE.withimg .img{
  /*
  background: url(imgs/imgs.png) no-repeat left center;
  background-size: 27px 100%;
  */
  border:0; padding:0; margin:0; vertical-align: middle;
}
#img-brace	{
  /*
  width: 7px; 
  background-position: -20px center;
  */
  width: 14px;
  background-image: url(imgs/brace.svg);
  background-size: 100% 100%;
}

.inTable .matrix-img-brace {
  padding:0;
  margin:0;
}

.matrix-img-brace	{ width: 7px; background-position: -20px center; }

#br-left,#br-right,#br-brace{
width:8px;
height:100%;
}
#br-line,#br-pline{
width:2px;
height:100%;
}

[draggable=true] {
  cursor: move;
}

/* new */

.inTable > tbody > tr > td:first-child {
  padding-left: 0;
}
.inTable > tbody > tr > td:last-child {
  padding-right: 0;
}

.inTable td.last{
  padding-right: 0;
}
.inTable td.first{
  padding-left: 0;
}

.matrix .matrix-img-left,
.matrix .matrix-img-right,
.inTable .matrix-img-line,
.inTable .matrix-img-pline,
.inTable .matrix-img-left,
.inTable .matrix-img-right {
  padding: 0;
}

.inTable .matrix-img-line{
  width: 0;
  border:1px solid #555;
  margin: 4px;
}
.inTable .matrix-img-pline{
  width: 0;
  border-left: 1px solid #555;
  margin:1px;
}
.inTable .matrix-img-left,
.inTable .matrix-img-right,
.matrix .matrix-img-left,
.matrix .matrix-img-right{
  width:6px;
  border:2px solid #555;
  border-right:0;
  border-top-left-radius: 10px 40px;
  border-bottom-left-radius: 10px 40px;
}
.inTable .matrix-img-right,
.matrix .matrix-img-right{
  border:2px solid #555;
  border-left:0;
  border-radius:0;
  border-top-right-radius: 10px 40px;
  border-bottom-right-radius: 10px 40px;
}

  .mathmlcontainer {
    vertical-align: middle;
    display: inline-block;
  }

.textarea > table {
  display: none;
}
.textarea textarea {
  width: 90%;
  min-height: 80px;
}
.cells > textarea {
  display: none;
}

.langBgOnly,
.langEnOnly,
.langRuOnly {
  display: none;
}

.langEnOnly:lang(bg),
.langEnOnly:lang(en),
.langRuOnly:lang(ru) {
  display: block;
}


.noScript {
  color: red;
  font-weight: bold;
}

.wikiLink {
  color: #007700;
}


/* .matrix-menu */

.matrix-container {
  position: relative;
  display: inline-block;
  cursor: move;
}

.matrix-menu-show {
  display: inline-block;
  width: 16px;
  height: 16px;
  position: absolute;
  right: -12px;
  bottom: 0;
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAD+SURBVHjaYvz//z8DJYCJgUIwDAxggTFycnL+MzMzM4AwOzs7Azc3NwMnJyeY5uLiAouBMBsbGwMw4L96e3vzoBjw69evOXJycinq6uoMrKysYIUwDOKDMMjwJ0+e/GdkZJwM08eIHI0ZGRkLgIbEgwz58+cPAxMTE9hWHh4esEvev3/P8OXLl46QkJBKrGEwY8aMBKANi2/dugW2GWgTGLOwsIBsZnj+/Hk/smYMF8BAdnb2SllZ2TAtLS2wQS9evADZPr+wsDAJXS0jrpSYm5u7Rl5ePhjk9zdv3ixtbm6OwRsL6AAYqBFAZ68HekG/v78/Bpc6xtG8wAAQYADNAlnnEq1XFAAAAABJRU5ErkJggg==");
  cursor: pointer;
}

.matrix-menu-show:hover {
  background-color: #ccc;
}

.matrix-menu-show:active {
  background-color: #aaa;
}

.matrix-menu {
  margin: 0;
  margin-left: -6px;
  padding: 0;
  position: absolute;
  left: 100%;
  top: 100%;
  display: block;
  z-index: 1;
  background: white;
  border: 1px solid silver;
  list-style: none;
}

.matrix-menu.closed {
  visibility: hidden;
}

.matrix-menu a {
  padding: 2px 8px 2px 4px;
  display: block;
  font-size: small;
  white-space: nowrap;
  background: #eef;
  cursor: pointer;
}

.matrix-menu a:hover {
  background: #bbc;
}

.matrix-menu a:active {
  background: #99b;
}