* {
	-webkit-tap-highlight-color: rgba(0,0,0,0);
}

body {
	background: #fff url(/cdn/cropout/i/transgrid.png);
	font: 300 100% "Open Sans",sans-serif; color: #000;
	-webkit-touch-callout: none;
	-webkit-text-size-adjust: none;
	-webkit-user-select: none;
}
@media (orientation: portrait) {
	body {
		border-top-color: #fff; border-top-style: solid; border-top-width: 0; border-top-width: env(safe-area-inset-top);
	}
}

div {
	box-sizing: border-box;
}
a {
	color: #fff; text-decoration: none;
}

.btn {
	-webkit-appearance: none;
	display: block; box-sizing: border-box;
	width: 100%; height: 2.5rem; margin: 0; padding: 0 1rem 0 0;
	background: #c40027; border: none; border-radius: 2rem;
	font: 1rem "Open Sans",sans-serif; color: #fff; text-shadow: 1px 1px 1px rgba(0,0,0,0.37);
	cursor: pointer;
}
.btn.negative { background: #333; }
.btn ~ .btn {
	margin-left: 0.5rem;
}
.btn img {
	display: inline;
	width: 1.25rem; height: 1.25rem; margin-right: 0.375rem;
	vertical-align: middle;
}
.btn .label {
	display: inline;
	vertical-align: middle; white-space: nowrap; line-height: 2.5rem;
}

#work {
	display: block; position: fixed;
	left: 0; right: 0; top: 0; bottom: 0; padding: 2rem;
	overflow: hidden;
	transition: opacity 0.25s;
}
@media (orientation: landscape) {
	#work {
		left: 3.5rem;
		right: 3.5rem;
		bottom: env(safe-area-inset-bottom);
	}
}
@media (orientation: portrait) {
	#work {
		top: 3.5rem;
		bottom: 3.5rem;
	}
}
#work.pause {
	opacity: 0.1;
}
#photo {
	display: block; position: relative;
}
#photo canvas {
	display: block;
	width: 100%; height: 100%;
}
#select {
	display: none; position: absolute;
	background: rgba(0,0,0,0.7); box-shadow: 0 0 0 1px #000 inset;
}
#select.active {
	display: block;
}
#select.x {
	left: 40%; width: 20%; top: 0; bottom: 0;
}
#select.y {
	left: 0; right: 0; top: 40%; height: 20%;
}
#select .ui-resizable-handle {
	display: none; position: absolute; box-sizing: border-box;
	width: 1.5rem; height: 1.5rem;
	background: rgba(255,255,255,0.7); border: 1px solid #0009;
		background-image: url("/cdn/splicecrop/i/icons/v2/grip.svg?x=1"); background-position: center center; background-repeat: no-repeat; background-size: 0.5rem;
}
#select .ui-resizable-handle.ui-resizable-n { left: 50%; top: -1.5rem; width: 5rem; margin-left: -2.5rem; border-bottom: none; }
#select .ui-resizable-handle.ui-resizable-e { right: -1.5rem; top: 50%; height: 5rem; margin-top: -2.5rem; border-left: none; }
#select .ui-resizable-handle.ui-resizable-s { left: 50%; bottom: -1.5rem; width: 5rem; margin-left: -2.5rem; border-top: none; }
#select .ui-resizable-handle.ui-resizable-w { left: -1.5rem; top: 50%; height: 5rem; margin-top: -2.5rem; border-right: none; }
#process {
	display: none; position: absolute;
	left: 50%; top: 50%; width: 7rem; height: 7rem; margin: -4.5rem 0 0 -4.5rem; padding: 1rem;
	background: rgba(0,0,0,0.79); border-radius: 4.5rem;
}
#process .spin {
	display: block;
	width: 100%; height: 100%;
	-webkit-animation: spin-full 1s infinite linear;
}
@-webkit-keyframes spin-full {
	0% { -webkit-transform: rotate(0deg); }
	100% { -webkit-transform: rotate(360deg); }
}
#advert {
	display: block; position: absolute;
	left: 50%; top: 50%; width: 336px; height: 280px; margin: -140px 0 0 -168px; transform: scale(0.8571, 0.8571);
}
#advert .adsbygoogle {
	display: block;
	width: 336px; height: 280px;
}
@media (min-width: 400px)
{
	#advert {
		margin: -140px 0 0 -168px; transform: scale(1, 1)
	}
}
@media (orientation: portrait) {
	#advert {
		top: 37%;
	}
}
@media (orientation: landscape) {
	#advert {
		left: 37%;
	}
}

/* Zoom bar */
#zoombar {
	display: block; position: fixed;
	background: #fff; z-index: 60;
}
@media (orientation: landscape) {
	#zoombar {
		left: 0; top: 0; bottom: 0; width: 2rem;
		padding-left: env(safe-area-inset-left);
	}
}
@media (orientation: portrait) {
	#zoombar {
		left: 0; right: 0; top: 0; height: 2rem;
		padding-top: env(safe-area-inset-top);
	}
}
#zoom_track {
	position: absolute;
}
#zoom_track::before {
	content: "";
	display: block; position: absolute;
	background: #aaa; border-radius: 2px;
}
@media (orientation: landscape) {
	#zoom_track {
		right: -2px; width: 4px;
		top: calc(31.25% - 4.375rem); bottom: calc(31.25% - 0.125rem);
	}
	#zoom_track::before {
		left: 0; right: 0;
		top: 1.25rem; bottom: 1.25rem;
	}
}
@media (orientation: portrait) {
	#zoom_track {
		bottom: -2px; height: 4px;
		left: calc(31.25% - 0.125rem); right: calc(31.25% - 4.375rem);
	}
	#zoom_track::before {
		top: 0; bottom: 0;
		left: 1.25rem; right: 1.25rem;
	}
}
#zoom_handle {
	position: absolute;
	width: 2.5rem; height: 2.5rem;
	background: #aaa; border-radius: 50%;
	box-shadow: 0 0 1px #0005 inset;
	z-index: 10;
}
#zoom_handle.active {
	background: #c40027;
	cursor: pointer;
}
@media (orientation: landscape) {
	#zoom_handle {
		left: 50%; margin-left: -1.25rem;
		top: 0;
	}
}
@media (orientation: portrait) {
	#zoom_handle {
		top: 50%; margin-top: -1.25rem;
		left: 0;
	}
}
#zoom_label {
	position: absolute;
	width: 2.5rem; height: 2.5rem;
	background: #fff; border-radius: 1.25rem;
	box-shadow: 0 0 1px #0005 inset;
	font-size: 0.75rem; color: #555; white-space: nowrap;
	line-height: 2.5rem; text-align: center;
	pointer-events: none;
	z-index: 10;
}
@media (orientation: landscape) {
	#zoom_label {
		right: -1.25rem;
		bottom: calc(31.25% - 4.375rem);
	}
}
@media (orientation: portrait) {
	#zoom_label {
		bottom: -1.25rem;
		left: calc(31.25% - 4.375rem);
	}
}

#toolbar {
	display: block; position: fixed;
	right: 0; bottom: 0;
	background: #fff;
}
@media (orientation: landscape) {
	#toolbar {
		top: 0; width: 2rem;
		padding-right: env(safe-area-inset-right);
	}
}
@media (orientation: portrait) {
	#toolbar {
		left: 0; height: 2rem;
		padding-bottom: env(safe-area-inset-bottom);
	}
}

#toolbar .ctrls {
	display: grid; position: absolute;
}
#toolbar .ctrl {
	display: block; position: relative;
}
@media (orientation: landscape) {
	#toolbar .ctrls {
		grid-template-rows: 5fr 2.5rem 0.75rem 2.5rem 3fr 2.5rem 3fr 2.5rem 0.75rem 2.5rem 5fr;
		top: 0; bottom: 0; left: -1.25rem;
	}
	#toolbar #ctrl_load { grid-row-start: 2; }
	#toolbar #ctrl_undo { grid-row-start: 4; }
	#toolbar #ctrl_home { grid-row-start: 6; }
	#toolbar #ctrl_crop { grid-row-start: 8; }
	#toolbar #ctrl_save { grid-row-start: 10; }
}
@media (orientation: portrait) {
	#toolbar .ctrls {
		grid-template-columns: 5fr 2.5rem 0.75rem 2.5rem 3fr 2.5rem 3fr 2.5rem 0.75rem 2.5rem 5fr;
		left: 0; right: 0; top: -1.25rem;
	}
	#toolbar #ctrl_load { grid-column-start: 2; }
	#toolbar #ctrl_undo { grid-column-start: 4; }
	#toolbar #ctrl_home { grid-column-start: 6; }
	#toolbar #ctrl_crop { grid-column-start: 8; }
	#toolbar #ctrl_save { grid-column-start: 10; }
}

#toolbar .icon {
	display: block; position: relative; z-index: 50;
	width: 2.5rem; height: 2.5rem;
	background: #aaa; border-radius: 1.25rem;
	box-shadow: 0 0 1px #0005 inset;
}
#toolbar .ctrl.active .icon {
	background: #c40027;
	cursor: pointer;
}
#toolbar .icon img {
	display: block; position: absolute;
	left: 0.625rem; top: 0.625rem; width: 1.25rem; height: 1.25rem;
}
#toolbar #ctrl_home .icon {
	background: #fff;
}
#toolbar .ctrl .more {
	display: block; position: absolute; z-index: 30;
	left: 0; top: 0;
}
#toolbar .ctrl .more .icon {
	display: block; position: absolute;
	left: 0; top: 0;
	transition-property: top, left; transition-duration: 0.25s;
}
@media (orientation: landscape) {
	#toolbar .ctrl.expand .more .icon:first-child { left: -3.25rem; }
	#toolbar .ctrl.expand .more .icon:nth-child(2) { left: -6.5rem; }
	#toolbar .ctrl.expand .more .icon:nth-child(3) { left: -9.75rem; }
}
@media (orientation: portrait) {
	#toolbar .ctrl.expand .more .icon:first-child { top: -3.25rem; }
	#toolbar .ctrl.expand .more .icon:nth-child(2) { top: -6.5rem; }
	#toolbar .ctrl.expand .more .icon:nth-child(3) { top: -9.75rem; }
}

#in_upload {
	display: none;
}

#toolbar .icon .label {
	display: block; position: absolute;
	font-size: 1.125rem; color: #555; line-height: 2.5rem; white-space: nowrap;
}
#toolbar .icon .label::after {
	content: "";
	display: block; position: absolute;
}
#toolbar .ctrl .more .icon .label {
	display: none;
}
#toolbar .ctrl.expand .more .icon .label {
	display: block;
	font-size: 1rem;
}
@media (orientation: landscape) {
	#toolbar .icon .label.primary {
		top: 0; right: 5.5rem;
	}
	#toolbar .icon .label.primary::after {
		top: 1.25rem; right: -2.5rem; width: 2rem;
		border-top: 1px solid #999;
	}


	#toolbar .more .icon .label {
		left: -3rem; width: 2.5rem;
	}
	#toolbar .more .icon .label .text {
		display: block;
		padding-left: 1.25rem;
	}
	#toolbar .more .icon .label::after {
		top: 1.7rem; bottom: -1.5rem; left: 1.25rem;
		border-left: 1px solid #999;
	}

	#toolbar .more.load .icon .label { top: 3.5rem; transform: rotate(-135deg); }
	#toolbar .more.load .icon .label .text { transform: rotate(-150deg); }
	#toolbar .more.save .icon .label { bottom: 3.5rem; transform: rotate(-45deg); }
	#toolbar .more.save .icon .label .text { transform: rotate(-30deg); }
}
@media (orientation: portrait) {
	#toolbar .icon .label.primary {
		bottom: 4.5rem; left: -1rem; width: 2.5rem;
		transform: rotate(-20deg);
	}
	#toolbar .icon .label.primary .text {
		display: block;
		padding-left: 1.25rem;
		transform: rotate(-50deg);
	}
	#toolbar .icon .label.primary::after {
		top: 1.7rem; bottom: -1.5rem; left: 1.25rem;
		border-left: 1px solid #999;
	}

	#toolbar .more .icon .label {
		top: 0;
	}
	#toolbar .more.load .icon .label::after {
		top: 1.25rem; width: 1rem;
		border-top: 1px solid #999;
	}
	#toolbar .more.load .icon .label { left: 4.5rem; }
	#toolbar .more.load .icon .label::after { left: -1.5rem; }
	#toolbar .more.save .icon .label { right: 4.5rem; }
	#toolbar .more.save .icon .label::after { right: -1.5rem; }
}

#notify {
	display: none; position: fixed; z-index: 100;
	left: 0; right: 0; bottom: 0; padding: 2rem;
	background: rgba(0,0,0,0.75);
	color: #fff; text-align: center;
}

#unlock {
	display: none; position: fixed; z-index: 100;
	left: 0; right: 0; top: 0; bottom: 0; padding: 2rem;
	background: rgba(0,0,0,0.7);
}
@media (orientation: portrait) {
	#unlock {
		padding-top: env(safe-area-inset-top);
	}
}
#unlock .constrain {
	display: block; position: relative; box-sizing: border-box;
	max-width: 480px; margin: 2rem auto; padding: 2rem;
	background: rgba(255,255,255,0.95); box-shadow: 0 0 2px rgba(0,0,0,0.3);
	text-align: center;
}
#unlock .purchase p {
	margin-top: 0.75rem;
}
#unlock .download {
	margin-top: 1.5rem;
}
#unlock .validate {
	margin-top: 1.5rem;
}
#unlock #fnc_validate {
	font-size: 0.9em; text-decoration: underline;
	cursor: pointer;
}
#unlock .btn {
	max-width: 280px; margin: 0 auto;
}
#unlock .close {
	margin-top: 1.5rem;
}
