:root {
  --bg-color: #ffffff;
  --btn-back: #a0a0ff;
  --ctrl-back: #a0a0ff;
  --btn-sel-back: #8080ff;
  --inp-back: #a0ffa0;
  --solution-color: #f00;
  --edit-back: #80ff80;
  --mark-back: #d0ffd0;
  --move-back: #d0d0ff;
  --help-back: #ffff80;
  --help-fore: #000000;
  --news-back: #804080;
  --news-fore: #ffffff;
  --confirm-back: #ffa0a0;
  --confirm-for: #ffe0e0;
  --defbtn-back: #a04040;
  --defbtn-fore: #ffffff;
  --api-back: #ff00ff;
  --api-fore: #ffffff;
}

#root,body {
  display: flex;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  font-family: roboto,verdana,tahoma,arial;
  flex-direction: row;
}

div {
  display: flex;
}

#webApi {
  flex-direction: column;
  background: var(--api-back);
  color: var(--api-fore);
  padding-top: 3em;
}

#webApi button {
  height: 3em;
}

#main {
  flex-direction: column;
  flex: 1;
  background: var(--bg-color);
  align-items: center;
  justify-content: center;
}

#pnlEdit {
  flex-direction: row;
  background: var(--inp-back);
  padding: 0.5em;
  width: 90%;
  height: 12em;
  align-items: center;
}

#pnlNr {
  font-size: 3em;
  align-items: center;
  justify-content: center;
}

#pnlDesc {
  flex-direction: column;
  flex: 1;
}

#btnSave {
  width: 10em;
  background: rgba(0,0,0,0.3);
}

#solveDesc {
  font-size: 2em;
}

.topInfo {
  -height: 100px;
  align-items: flex-end;
  padding: 12px;
  background: transparent;
  margin: 0 2.5em;
}

#currnum {
  font-size: 2em;
  font-weight: bold;
}

#currnum span {
  background: var(--inp-back);
  padding: 0 0.5em;
  cursor: pointer;
}

#solutiondesc {
  font-size: 2em;
  font-weight: bold;
}

#solutiondesc span {
  color: var(--solution-color);
  padding: 0 0.5em;
  cursor: pointer;
}

.pnlInp {
  flex-direction: column;
  margin-bottom: 1em;
}

input:disabled {
  background: rgba(0,0,0,0.1);
}

.nr {
  padding: 0.5em;
}

.pnlInp .title {
  margin-right: 1em;
  width: 6em;
  align-items: center;
}

.pnlInp .input {
  flex: 1;
  align-items: center;
}

.pnlInp .input input {
  flex: 1;
  height: 2em;
}

.pnlInp .desc {
  margin-right: 1em;
}

#pnlArea {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
}

#dscHover  {
  margin-top: 1em;
  height: 3em;
}

.areaPanel {
  flex-flow: column;
  align-items: center;
  overflow-y: auto;
}

.area {
  flex-flow: column;
  margin-bottom: 1em;
}

#controls {
  width: 200px;
  flex-direction: column;
  background: var(--ctrl-back);
  justify-content: space-between;
}

#controls div {
  flex-direction: column;
}

#controls .sizer {
  flex-direction: row;
  align-items: center;
}

#dimensions {
  background: #30a0ff;
  color: rgba(255,255,255,0.7);
}

#lines {
  flex-direction: row !important;
  align-items: center;
  padding: 0.5em;
}

#lines button {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin: 0;
}

#controls .sizerhead {
  flex-direction: row;
  flex: 1;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  padding: 0.2em 0;
}

#controls .sizerhead[onclick] {
  cursor: pointer;
}

#controls .sizer * {
  flex: 1;
  align-items: center;
  justify-content: center;
}

button {
  display: flex;
  background: var(--btn-back);
  border: none;
  margin: 0.5em;
  padding: 0.5em;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255,255,255,0.3);
  border: 1px solid transparent;
}

button:hover {
  background: rgba(255,255,255,0.8);
}

button:focus {
  outline: none;
  border: 1px solid rgba(0,0,0,0.5);
}

button.selected {
  background: var(--btn-sel-back);
}

#btnSolve {
  padding: 1em;
}

#controls>div:first-child {
  flex: 1;
  overflow-y: hidden;
}

#defAreas::-webkit-scrollbar {
  width: auto;
}
#defAreas::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
}
#defAreas::-webkit-scrollbar-track {
  background-color: var(--ctrl-back);
}

#defAreas {
  overflow-y: auto;
  flex: 1;
}

#defAreas .btnLine {
  display: flex;
  flex-flow: row;
  background: blue;
  flex: 1;
  margin: 0.25em;
}

#defAreas .btnLine button {
  margin: 0;
}

#defAreas .btnLine button:first-child {
  flex: 1;
}

#defAreas button {
  background: var(--defbtn-back);
  color: var(--defbtn-fore);
  fill: var(--defbtn-fore);
}

#importArea {
  display: none;
}

div[cell] {
  position: relative;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

div[cont] {
  font-weight: bold;
  font-size: 1.5em;
}

.desc div[cont] {
  color: #181;
  // text-shadow: 0 0 3px #080, 0 0 5px #080;
}

div[back] {
  position: absolute;
  right: 0.1em;
  top: 0.1em;
}

div[solution] {
  position: absolute;
  bottom: 0.1em;
  right: 0.1em;
  align-items: center;
  justify-content: center;
  font-size: 1.0em;
  color: var(--solution-color);
}

div[solutionBig] {
  position: absolute;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  color: var(--solution-color);
  opacity: 0.5;
}

div[num] {
  position: absolute;
  top: 0.4em;
  left: 0.4em;
  font-size: 0.6em;
}

svg[horz] {
  position: absolute;
  right: -5px;
  fill: red;
}

svg[vert] {
  position: absolute;
  bottom: -5px;
  fill: red;
}

.area table  {
  background: black;
}

.area table,td,tr,td>div {
  cursor: pointer;
}

.area td {
  width: 3em;
  height: 3em;
  border: none;
  background: var(--bg-color);
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  border: 2px solid transparent;
}

.area td.vert {
  border-right: 2px solid black !important;
}

.area td.horz {
  border-bottom: 2px solid black !important;
}

.area td.error {
  color: red;
}

.area td.block {
  background: black;
}

.area td.block div {
  color: white;
}

.area td.edit {
  background-color: var(--edit-back) !important;
  border: 2px solid rgba(0,255,0,0.5);
}

.area td.edit.curr div[cell] div[cont] {
  text-decoration: underline;
}

.area td.edit.move {
  border: 2px solid rgba(0,0,255,0.5);
}

.area td.mark {
  background: var(--mark-back);
}

.area td.move {
  background: var(--move-back);
}

.info {
  position: absolute;
  right: 18em;
  font-size: 75%;
  font-weight: bold;
}

#lines .info {  
  position: inherit;
}

#help,#news {
  flex-direction: column;
  position: absolute;
  left: 25vw;
  top: 10vh;
  border: 1px solid black;
  width: 50vw;
  height: 80vh;
  padding: 1em;
  font-size: 90%;
}

#news {
  background: var(--news-back);
  color: var(--news-fore);
}

#news .title {
  font-size: 170%;
  font-weight: bold;
}

#hideNews {
  border-radius: 50%;
  font-size: 1em;
  font-weight: bold;
  width: 2em;
  height: 2em;
}

#hideHelp {
  border-radius: 50%;
  font-size: 1em;
  font-weight: bold;
  width: 2em;
  height: 2em;
  background: rgba(0,0,0,0.5);
}

#news div[header],
#help div[header] {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

#news .root {
  flex-direction: column;
  padding: 1em;
  font-size: 1em;
  background-color: var(--news-back);
  color: var(--news-fore);
  overflow-y: auto;
}

#news h1 {
  font-size: 2em;
  padding: 0 0.1em;
  margin: 0;
}

#news h2 {
  font-size: 1.3em;
  padding: 0 0.5em;
  margin: 0;
  font-weight: 600;
}

#news h2 span:first-child {
  padding-right: 0.5em;
}

#news ul {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 1.0em 0 1.5em 0;
}

#news li {
  list-style: none;
  margin-left: 0;
  padding-left: 2.0em;
  text-indent: -0.6em;
}

#news li:before {
  content: "-";
  margin-right: 0.3em;
  margin-left: -0.9em;
}

#news .added:before {
  content: "+";
}

#news .changed:before {
  content: "~";
}

#news .removed:before {
  content: "-";
  margin-right: 0.6em;
  margin-left: -0.8em;
}

#news .fixed:before {
  content: "#";
}

#showNews {
  background: var(--news-back) !important;
  color: var(--news-fore) !important;
}

#help {
  background: var(--help-back);
  color: var(--help-fore);
}

#help div {
  display: block;
}

#help .mode {
  overflow-y: auto;
}

#help .title {
  font-size: 170%;
  font-weight: bold;
  flex-direction: row;
  align-items: flex-end;
  display: flex;
  padding-top: 0 !important;
}

#help .title .version {
  font-size: 0.4em;
  padding-bottom: 2px;
  padding-left: 0.5em;
}

#help .title div {
  padding-top: 0 !important;
}

#help div:not(.title) {
  padding-top: 1em;
}

#help table {
  background: transparent;
  border: none;
  width: 100%;
}

#help tr:first-child {
  background: rgba(0,0,0,0.2);
  font-weight: bold;
}

#help tr:first-child td {
  padding: 0.5em;
}

#help td {
  background: transparent;
  padding: 0.1em 0.5em;
}

#help td:not(first-child) {
  width: auto;
}

#helpCtrls {
  display: flex !important;
  justify-content: space-between;
  flex-direction: row;
  flex: 1;
  align-items: flex-end;
  width: 100%;
}

#helpCtrls div {
  display: flex !important;
}

#helpCtrls div button {
  background: rgba(0,0,0,0.2);
  color: rgba(0,0,0,0.6);
  height: 3em;
}

.overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(100,100,255,0.7);
}

.dlg {
  position: absolute;
  left: 25vw;
  top: 20vh;
  border: 1px solid black;
  width: 50vw;
  background: var(--confirm-back);
  color: var(--confirm-fore);
  padding: 0;
  flex-direction: column;
  justify-content: space-between;
}

.dlg .title {
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 0.6em;
  font-weight: bold;
  align-items: center;
}

.dlg .title svg {
  margin-right: 0.5em;
  fill: white;
}

.dlg .question {
  padding: 1.0em;
}

.dlg .ctrls {
  flex-direction: column;
}
.dlg .ctrls table {
  margin: 1em;
}
.dlg .ctrls td {
  padding: 0.5em 0;
}
.dlg .ctrls td:first-child {
  width: 8em;
  vertical-align: top;
}
.dlg .ctrls textarea {
  width: 100%;
}
.dlg .btns {
  justify-content: flex-end;
  align-items: center;
}

.dlg .btns button {
  background-color: rgba(0,0,0,0.3);
  width: 6em;
  color: black;
  font-weight: bold;
}

.dlg .editor {
  flex-direction: column;
  padding: 1em;
}

.dlg .editor .row {
  flex-direction: row;
  margin-bottom: 0.5em;
  align-items: center;
}

.dlg .editor .row button {
  height: 20px;
  background: transparent;
}

.dlg .editor .row>div:first-child {
  width: 12em;
  flex-direction: row;
}

#uploadInfo {
  padding-left: 1em;
  font-size: 80%;
  font-weight: bold;
  color: rgba(128,0,0,0.8);
}

#upload .title {
  justify-content: space-between;
}

#showHelp {
  position: absolute;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: var(--help-back);
  color: var(--help-fore);
  border: 1px solid black;
  font-size: 1em;
  font-weight: bold;
  width: 2em;
  height: 2em;
}

.userbtn {
  display: flex;
  align-self: flex-end;
  justify-self: flex-end;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 5px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
}

.userimg {
  border-radius: 50%;
  width: 48px;
}

.g-signing2 {
  cursor: pointer;
}

#btnsolution svg {
  fill: var(--solution-color);
}
#display {
  overflow-y: auto;
  max-height: 30vh;
  padding: 0.5em;
}
.dspHead {
  font-weight: bold;
}
.dspNum {
  font-weight: bold;
  padding-right: 0.5em;
  vertical-align: top;
}
.dws {
  padding-right: 0.5em;
  vertical-align: top;
}
.dss {
  padding-left: 0.5em;
  vertical-align: top;
}
.dspSol {
  padding-top: 1em;
  text-align: center;
}
#gendesc {
  flex-flow: column;
}
div[words] {
  display: flex;
  justify-content: center;
  min-height: 1.5em;
  max-width: 50vw;
}
