
.no-select{
	-webkit-user-select: none;
	-moz-user-select: none;
	-khtml-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

#container{
	position: relative;
	margin: 70px 0 0 240px;
	min-height: 100vh;
	max-width: 940px;
	margin: 70px auto 0;
}

#container h1{
	position:absolute;
	top: -70px;
	font-size:30px;
	color:#fff;
	text-shadow: 1px 2px 3px #000;
	text-align: center;
	width: 100%;
}

#letter_text, #letter_text_test, #letter_text_dpi{
	width: 80%;
	text-align: justify;
	margin:0 auto;
	font-family: 'Marck Script', cursive;
	font-size: 25px;
	line-height: 1.1em;
	color:#003399;
	white-space: pre-wrap;
	word-wrap: break-word;
	letter-spacing: normal;
	word-spacing: normal;
}

#letter_text{
	transition: opacity 0.5s;
	opacity: 1;
}

#letter_text_test, #letter_text_dpi{
	position: absolute;
	top: -9999px;
	left: 0;
	visibility: hidden;
}

#scale-container{
	margin-left: 90px;
	position: relative;
	width: 850px;
	max-width: 100%;
}

#zoom-place{
	position: absolute;
	left: -42px;
	top: 28px;
	z-index: 11;
	text-align: center;
}

.zoom-bt{
	font-family: "fontello";
	margin-bottom: 10px;
	font-style: normal;
	width: 32px;
	height: 32px;
	line-height: 32px;
	text-align: center;
	border: 1px solid #aaa;
	border-radius: 50%;
	cursor: pointer;
	background: #eee;
	color: #444;
}

.zoom-bt:hover{
	border: 1px solid #777;
}

.zoom-bt:active{
	box-shadow: inset 0px 0px 4px #777;
}

.zoom-title{
	width: 60px;
	text-align: right;
	font-size: 16px;
	position: absolute;
	top: -25px;
	left: -52px;
	color: #fff;
	text-shadow: 1px 2px 3px #000;
}
/*
#scale-container::before{
	content: ' ';
	display: block;
	padding-top: 141%;
}
*/
#scalable_elements{
	overflow: hidden;
	display: block;
	padding-top: 141%;
}

#scalable_elements #letter-sample, #scalable_elements #stamp-canvas {
	position: absolute;
	top: 0;
	left: 0;
	transform: scale(1);
	transform-origin: 0px 0px;
	transition: opacity 0.5s, transform 0.3s;
}
	
#letter-sample {
	width: 850px;
	background-color: #fff;
	transform-origin: 0px 0px;
	box-shadow: 1px 1px 5px #000;
}

#letter-sample.read-letter b{
	font-weight: normal;
}

#envelope{
	position: relative;
}

#envelope img.envelope{
	max-width: 100%;
	image-rendering: -webkit-optimize-contrast;
}

#envelope div.envelope-text{
	position: absolute;
	line-height: 31px;
	text-align: left;
}

#envelope div.envelope-text.envelope-index{
	font-family: Roboto, sans-serif;
	text-align: center;
	margin-top: 0;
	color: #333;
}

#envelope div.envelope-text[data-name="name_from"]{
	top: 181px;
    left: 118px;
    background: none;
	width: 300px;
}

#envelope div.envelope-text[data-name="address_from"]{
	top: 212px;
    left: 68px;
    width: 345px;
    text-indent: 50px;
}

#envelope div.envelope-text[data-name="name_to"]{
	top: 368px;
	left: 424px;
	width: 345px;
	text-indent: 35px;
}

#envelope div.envelope-text[data-name="address_to"]{
	top: 432px;
	left: 424px;
	width: 345px;
	text-indent: 35px;
}

#envelope div.envelope-text[data-name="index_from"]{
	top: 302px;
	left: 266px;
	width: 150px;
}

#envelope div.envelope-text[data-name="index_to"]{
	top: 520px;
	left: 423px;
	width: 173px;
	line-height: 40px;
	font-size: 34px;
}

#envelope div#index_to{
	top: 537px;
	left: 140px;
	width: 253px;
	line-height: 40px;
	font-size: 34px;
	/* background: #fff5; */
	height: 52px;
}

#index_to div{
	position: absolute;
	display: block;
	background-image: url(/ded-moroz/images/envelope-index.png);
	width: 29px;
	height: 52px;
	background-size: auto 100%;
	top: 0;
}

#index_to div.pos1{
	left: 0;
}

#index_to div.pos2{
	left: 45px;
}

#index_to div.pos3{
	left: 90px;
}

#index_to div.pos4{
	left: 135px;
}

#index_to div.pos5{
	left: 180px;
}

#index_to div.pos6{
	left: 225px;
}

#index_to div[data-n="1"]{
	background-position: 0 0;
}
#index_to div[data-n="2"]{
	background-position: -45px 0;
}
#index_to div[data-n="3"]{
	background-position: -90px 0;
}
#index_to div[data-n="4"]{
	background-position: -135px 0;
}
#index_to div[data-n="5"]{
	background-position: -180px 0;
}
#index_to div[data-n="6"]{
	background-position: -225px 0;
}
#index_to div[data-n="7"]{
	background-position: -270px 0;
}
#index_to div[data-n="8"]{
	background-position: -315px 0;
}
#index_to div[data-n="9"]{
	background-position: -360px 0;
}
#index_to div[data-n="0"]{
	background-position: -405px 0;
}

#stamp-canvas{
	z-index: 8;
}

#under-the-letter {
	position: relative;
	z-index: 7;
	background: #fff;
	text-align: left;
	box-shadow: 1px 1px 5px #000;
	margin-left: 90px;
	margin-top: 15px;
	padding: 5px 7px;
	margin-bottom: 7px;
}

#under-the-letter h2{
	font-size: 20px;
	text-align: center;
	padding: 10px 0 0;
}

#under-the-letter::after{
	content: ' ';
	display: block;
	clear: both;
}

div.txt-edit p{
	margin: 0;
	padding: 0;
}

div.txt-edit label{
	cursor: pointer;
}

div.txt-edit input[type="radio"]{
	width: 18px;
	height: 18px;
	vertical-align: text-bottom;
}

div.txt-edit  p.info, div.txt-edit  div.info{
	color: #045c9f;
	margin: 10px 0 5px;
	padding: 0;
	font-weight: bold;
}

div.txt-edit input[type="text"], div.txt-edit select{
	width: 100%;
	padding: 3px 1px;
}

div.txt-edit textarea{
	width: 100%;
	height: 1.3em;
	resize: vertical;
	font-size: 1.2em;
}

#steps fieldset{
	border-color: #046ab7;
}

#steps li.envelope-type label::last-child{
	margin-left: 7px;
}

#steps li.envelope-type u.envelope-type__help{
	font-size: 14px;
	color: #00f;
	cursor: pointer;
}

#steps li.envelope-type u.envelope-type__help:hover{
	color: #2e7fbc;
}

#steps li.envelope-type input[type="radio"]{
	width: 18px;
	height: 18px;
	vertical-align: text-bottom;
}

#steps li.no-list-style{
	list-style-type: none;
}

.letter_data{
	display: none;
}

#signet-place {
	width: 205px;
    height: 242px;
	margin: 0 auto;
	position: relative;
	background: url(/ded-moroz/images/footprint.png) no-repeat;
	background-position: 5px 68px;
}

#signet {
	width: 205px;
    height: 242px;
	background-image: url(/ded-moroz/images/signet.png);
	cursor: -webkit-grab;
	cursor: grab;
}

#signet:hover {
	background-position: -205px 0;
}

#signet:active {
	cursor: -webkit-grabbing;
	cursor: grabbing;
}

#signet-clone {
	display: block;
	width: 205px;
    height: 242px;
	user-drag: none; 
	-moz-user-select: none;
	-webkit-user-drag: none;
	z-index: 9;
	position: absolute;
	background-image: url(/ded-moroz/images/signet.png);
	background-position: -205px 0;
	transition: transform 0.1s;
	transform: scale(1);
	pointer-events: none;
	image-rendering: -webkit-optimize-contrast;
}

body.stamps-active{
	cursor: -webkit-grabbing;
	cursor: grabbing;
}

body.stamps-active #container{
	pointer-events: none;
}

#text-editor{
	z-index: 13;
	position: absolute;
	transform-origin: 0px 0px;
	top: 0;
	left: 0;
	width: 850px;
	height: 1200px;
	background: rgba(0,0,0,0.8);
	margin-left: 90px;
}

#text-editor textarea{
	width: 95%;
	height: 700px;
	margin-top: 300px;
	resize: none;
	font-family: 'Roboto', sans-serif;
	font-size: 17px;
	line-height: 25px;
}

#text-editor .d3-button{
	font-size: 20px;
}

#stamp-canvas{
	/*cursor: url("../images/pencil.ico") 0 0, help;*/
	cursor: text;
}

#like-buttons {
    width: 100%;
    text-align: center;
}

#DML-font{
	padding: 5px;
	border: 2px groove #046ab7;
	margin-left: 5px;
}

#DML-font.is_IOS{
	-webkit-appearance: initial;
}

#DML-font *{
	font-size: 16px;
}

.edit-text-bottom{
	position: relative;
	z-index: 7;
	margin: 7px 0 -7px;
}

.edit-text-bottom .d3-button{
	padding: 7px 20px;
}

.edit-text-bottom .d3-button img{
	margin: 0 5px -3px -5px;
}

.mobile-top-button{
	position: relative;
	z-index: 10;
	background: #fff;
	text-align: left;
	box-shadow: 1px 1px 5px #000;
	margin: 0 0 7px 90px;
	padding: 5px;
}

.mobile-top-button .d3-button{
	margin-right: 3px;
	padding: 7px 10px;
}

.mobile-top-button div.top-group{
	display: inline-block;
	margin-left: 7px;
}

#steps{
	width: 45%;
}

#MD-stamp{
	float: right;
	width: 45%;
}

#steps li{
	margin: 13px 0;
}

#steps li em{
	display: block;
	font-style: normal;
	margin-bottom: 5px;
}

#steps li em>i{
	font-style: normal;
	color: #0465af;
	font-weight: bold;
}

#under-the-letter .d3-button{
	width: 99%;
	padding: 7px 0;
	margin-top: 5px;
}

/*theme gallery {*/

#blank-gallery-popup, #text-gallery-popup{
	font-family: 'Roboto', sans-serif;
	color: #555;
	max-width: 1100px;
	padding: 0 20px;
}

#blank-gallery-popup h2, #text-gallery-popup h2{
	font-size: 1.5em;
	margin: 0 auto 15px;
}

#blank-gallery ul {
	display: block;
	list-style: none;
	margin: 0;
	padding: 0;
}

#blank-gallery li {
	margin: 6px 0.5%;
	text-align: center;
	transition: opacity .3s, transform .3s, margin 0.3s;
	position: relative;
	line-height: 0;
	width: 19%;
	float: left;
	box-shadow: 0px 0px 1px 1px #000;
}

#blank-gallery li:hover{
	box-shadow: 0px 0px 2px 2px #444;
}

#blank-gallery li img{
	cursor: pointer;
	height: auto;
	width: 100%;
	image-rendering: -webkit-optimize-contrast;
}

#blank-gallery li.selected img{
	cursor: default;
}

#blank-gallery li img.blank-loader{
	background: url(/ded-moroz/images/blank-loader.svg) 50%/36px no-repeat #ccc;
	transition: background-color .3s;
}

#blank-gallery li:hover img.blank-loader {
	background-color: hsl(0, 0%, 30%);
}

#blank-gallery li.selected{
}

#blank-gallery li.selected::after {
	background-image: url('/ded-moroz/images/checkmark.svg');
	background-position: 50% 50%;
	background-repeat: no-repeat;
	background-size: 25%;
	content: '';
	height: 100%;
	left: 0;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 100%;
}

#blank-gallery li.hidden {
	opacity: 0;
	pointer-events: none;
}

#text-gallery h3{
	text-align: left;
	background: #046ab7;
	color: #fff;
	padding: 3px 10px;
	font-weight: normal;
	font-size: 20px;
	margin: 0;
}

#text-gallery ol{
	list-style-type: disc;
}

#text-gallery ol li a{
	display: block;
	line-height: 25px;
	font-size: 18px;
	text-align: left;
	text-decoration: none;
	color: #333;
}

#text-gallery ol li a:hover{
	text-decoration: underline;
	color: #333;
}

#text-gallery ol li a.selected{
	text-decoration: none;
	background: #c4dbec;
}

#text-item-full {
	width: 65%;
	margin-left: 35%;
	display: block;
	text-align: center;
}

#text-item-full section{
	font-size: 16px;
	color: #222f46;
	margin: 10px 5% 20px;
	width: 90%;
	text-align: left;
	max-height: 70vh;
	overflow: auto;
	line-height: 20px;
	white-space: pre-line;
}

#text-item-full .d3-button{
	padding: 8px 15px;
}

.wish {
	width: 21%;
	margin: 10px 1%;
	padding: 10px 1%;
	background: #f1f0d5;
	border-radius: 5px;
	box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
	vertical-align: top;
	float: left;
	cursor: pointer;
	position: relative;
	text-align: left;
}

.wish.selected::after {
	background-image: url('/ded-moroz/images/checkmark.svg');
	background-position: 50% 50%;
	background-repeat: no-repeat;
	background-size: 24px;
	content: '';
	height: 100%;
	left: 0;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 100%;
}

.wish b{
	font-size: 14px;
	line-height: 25px;
	color: #3F51B5;
}

.wish .wish-text{
	height: 150px;
	overflow: hidden;
	color: #333;
}

.wish:hover{
	box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2), inset -1px -1px 2px rgba(0, 0, 0, 0.2);
}

#text-editor h3{
	display: none;
}

/*} theme gallery*/

#popup-edit-info{
	max-width: 320px;
	line-height: 22px;
	padding: 3px 0;
}

#popup-edit-info .d3-button{
	display: block;
	margin: 7px 5px 0;
	padding: 7px 0;
}

#popup-edit-info .black-background{
	background: #000;
	padding: 2px 7px;
	color: #fff;
}

.for_bad_mobiles{
	padding: 0 7px 20px;
}

.for_bad_mobiles .d3-button{
	padding: 9px 13px;
}

.how-to-edit{
	font-size: 20px;
    padding: 0px 7px 10px;
	font-family: 'Roboto', sans-serif;
}

.how-to-edit ol, .how-to-edit ul{
	text-align: left;
	padding: 0 0 0 30px;
	margin: 0;
}

.how-to-edit ul{
	padding: 0;
	list-style: none;
}

.how-to-edit ul li{
	background-image: url(/ded-moroz/images/checked.png);
	background-size: auto 90%;
	background-repeat: no-repeat;
	padding-left: 30px;
	background-position: left center;
}

.how-to-edit h3{
	font-size: 1em;
	margin: 12px 0;
}

.how-to-edit .d3-button{
	margin: 13px 0 3px;
}

.how-to-edit .how-to-edit-bottom{
	font-size: 0.7em;
	margin: 7px 0;
}

.d3-button {
    background-color: #e9d480;
}

.label-boy, .label-girl{
	display: inline-block;
}

.label-boy::before, .label-girl::before{
	content: ' ';
	display: inline-block;
	width: 50px;
	height: 50px;
	vertical-align: middle;
	background-size: cover;
}

.label-boy::before{
	background-image: url(/ded-moroz/images/boy.png);
}

.label-girl::before{
	background-image: url(/ded-moroz/images/girl.png);
}

#letter-form legend{
	background: #000;
	padding: 2px 7px;
	color: #fff;
}

#popup__content #save_template_form{
	display: block;
	margin: 7px 3px 0;
	padding: 7px 0;
	width: 100%;
}

@media (min-device-width:1201px){
	
	#text-gallery {
		width: 35%;
		float: left;
		overflow-y: scroll;
		border-right: 2px ridge #86b2f7;
		height: 70vh;
	}
	
	#text-gallery ol{
		list-style-image: url('/ded-moroz/images/list-item.png');
	}
	
	#text-gallery-popup .text-gallery-popup{
		width: 1100px;
		padding: 0;
	}
	
	#text-gallery-popup .text-gallery-popup{
		border: 2px ridge #86b2f7;
		border-radius: 10px;
	}
	
	div.edit-text-bottom{
		margin-left: 90px;
		width: calc(100% - 90px);
	}
	#under-the-letter .d3-button.half-width{
		width: 48%;
		margin: 5px 1% 0 0;
		margin-left: 25px;
	}
}

@media (max-device-width: 1200px) {
	#container{
		margin: 0;
	}
	#under-the-letter, #text-editor, #scale-container{
		margin-left: 0;
	}
	.mobile-top-button{
		padding-top: 10px;
		margin: 0 0 3px;
		text-align: center;
	}
	#container.text-editor-opened>*{
		display: none;
	}
	#container.text-editor-opened>#text-editor{
		display: block;
		position: fixed;
	}
	.mobile-top-button .d3-button {
		width: 49%;
		margin: 0 0.3%;
		padding: 10px 0;
	}
	.edit-text-bottom .d3-button {
		width: 98%;
		padding: 10px 0;
		margin: 7px 0;
	}
	.d3-button{
		font-size: 18px;
	}
	.edit-text-bottom .d3-button img{
		display: none;
	}
	#text-editor .d3-button {
		margin-top: 7px;
		padding: 7px 10px;
	}
	#text-editor {
		width: 100%!important;
		height: 100%!important;
		position: fixed;
		top: 0;
		left: 0;
	}
	#text-editor h3{
		display: block;
		margin: 0;
		padding: 10px;
		width: 98%;
		text-align: center;
		background-color: #e7e6e2;
	}
	#text-editor textarea {
		width: 96%;
		height: calc(100% - 123px);
		margin-top: 5px;
		-webkit-font-smoothing: antialiased;
		text-align: left;
		padding: 5px 1% 10px;
	}
	#text-gallery ol li a{
		line-height: 1.5em;
		text-align: left;
	}
	#text-item-full{
		width: 100%;
        margin-left: 0;
        text-align: center;
        padding: 0 0 7px;
		display: none;
	}
	#text-item-full section{
		font-size: 16px;
		color: #222f46;
		margin: 10px 1% 10px;
		width: 98%;
		text-align: left;
		max-height: 70vh;
		overflow: auto;
		line-height: 20px;
		white-space: pre-line;
	}
	#text-gallery-popup[data-mode="full_text"] #text-item-full{
		display: block;
		padding: 5px 0 15px;
	}
	#text-gallery-popup[data-mode="full_text"] h2, #text-gallery-popup[data-mode="full_text"] #text-gallery{
		display: none;
	}
	div.txt-edit textarea{
		font-size: 1.3em;
		height: 2em;
		margin: 0.3em 0;
		border: 2px solid #666;
		width: 99%;
	}
	#zoom-place{
		display: none;
	}
	.mobile-top-button div.top-group{
		display: block;
		margin: 10px 7px 5px;
	}
}

@media (max-device-width: 940px) {
	:root {
		--js-scale: 0.37;
	}
	#scalable_elements #letter-sample, #scalable_elements #stamp-canvas{
		transform: scale(0.37);
		transform: scale(var(--js-scale));
	}
}


@media (max-device-width: 800px){
	#popup {
		max-width: 100%;
	}	
	#popup__close{
		width: 5vw;
		height: 5vw;
		background-size: 100%;
	}	
	#blank-gallery li {
		margin: 6px 0.5%;
		width: 24%;
	}
	#blank-gallery-popup, #text-gallery-popup{
		padding: 0 0 5px;
	}
	.how-to-edit{
		font-size: 40px;
		font-size: 4vw;
    	padding: 20px 7px;
	}
	.how-to-edit .d3-button{
		margin: 13px 0 3px;
		font-size: 1.2em;
	}
	.how-to-edit ol{
		padding-left: 70px;
	}
	.how-to-edit ul{
		padding-left: 10px;
	}
	.how-to-edit ul li{
		padding-left: 60px;
	}
}

@media (max-device-width: 600px) {
	#blank-gallery li {
		width: 48%;
		margin: 6px 0.8%;
	}
	#steps{
		width: auto;
		/* display: none; */
	}
	#MD-stamp{
		float: none;
		width: auto;
		margin-bottom: 40px;
	}
	div.txt-edit input[type="text"]{
		font-size: 1.8em;
		margin: 0.3em 0;
	}
	div.txt-edit{
		margin: 30px 0 0;
	}
}

@media (max-device-width: 355px) {
	.label-boy::before, .label-girl::before{
		width: 35px;
		height: 35px;
	}
	#text-editor .d3-button {
		padding: 7px 2px;
	}
}

@media print{
	#container {
		display: none;
	}
}