body {
	padding: 0;
	margin: 0;
	height: 100vh;
	overflow: hidden;
	display: flex;
	flex-flow: row;
	font-size: 1.1em;
	font-family: Arial, sans;
	color: white;
}

::-webkit-scrollbar {width: 10px; height: 10px;}
::-webkit-scrollbar-track {background: #222; border-radius: 8px;}
::-webkit-scrollbar-thumb {background: #666; border-radius: 8px;}
::-webkit-scrollbar-thumb:hover {background: #888;}
::-webkit-scrollbar-corner {background: #222;}

main {
	background-color: #444;
	width: 80%;
	min-width: calc(100% - 250px);
	height: 100vh;
	display: flex;
	flex-flow: column;
	margin: 0;
	padding: 0;
}
@media only screen and (max-device-width: 960px), (max-width: 640px) {
	main {
		width: 100%;
	}
}

main .chat, main .textin {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

main .chat {
	display: block;
	height: calc(100vh - 4em);
	flex-flow: column;
	padding: 8px;
}
main .chat .channel {
	visibility: hidden;
	height: 0%;
	display: flex;
	flex-flow: column;
	overflow-y: scroll;
	overflow-x: hidden;
}
main .chat .channel .message:first-child {
	margin-top: auto;
}
main .chat .channel .message {
	display: flex;
	flex-flow: column;
	padding: 8px;
	width: calc(100% - 24px);
}
main .chat .channel .message:hover {
	background-color: #555;
}
main .chat .channel .message.pending {
	color: #aaa;
}
main .chat .channel .message.invalid {
	color: #f44;
}
main .chat .channel .message .from {
	display: flex;
	font-weight: bold;
	align-items: flex-end;
	color: white;
}
main .chat .channel .message .from .timestamp {
	font-weight: normal;
	color: #aaa;
	font-size: small;
	margin-left: 8px;
}
main .chat .channel .message a {
	color: #78d;
	cursor: pointer;
	text-decoration: underline;
}
main .chat .channel .message progress {
	width: 100%;
}
main .chat .channel .message .options {
	color: #fa0;
}

main .textin {
	display: flex;
	height: 4em;
	border-top: 1px solid #222;
	overflow: hidden;
	visibility: hidden;
	padding: 8px;
}
main .textin input[type=text] {
	background-color: #111;
	border: none;
	border-radius: 4px;
	padding: 0.4em;
	outline: none;
	width: 95%;
	margin: auto;
	color: white;
	box-sizing: border-box;
	font-size: 0.85em;
}
main .textin #file-button {
	margin: auto;
	margin-left: 0px;
	font-size: 2em;
	font-weight: bold;
	cursor: pointer;
	color: #bbb;
	padding-bottom: 4px;
}
main .textin input[type=file] {
	display: none;
}

aside {
	background-color: #333;
	min-width: 200px;
	width: 20%;
	max-width: 250px;
	height: 100vh;
	display: flex;
	flex-flow: column;
	margin: 0;
	padding: 0;
}
@media only screen and (max-device-width: 960px), (max-width: 640px) {
	aside {
		display: block;
		transform: translate(-100%, 0px);
		position: absolute;
		max-width: 500px;
		width: calc(100% - 80px);
		transition-duration: 0.5s;
		z-index: 10;
	}
}
@media only screen and (min-device-width: 960px) and (min-width: 640px) {
	aside {
		transform: none !important;
	}
}

aside .search, aside .contacts, aside .user {
	display: flex;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

aside .search {
	border-bottom: 1px solid #222;
	height: 2.5em;
	padding: 8px;
}
aside .search input {
	background-color: #111;
	border: none;
	border-radius: 4px;
	margin: auto;
	padding: 0.4em;
	outline: none;
	color: white;
	width: 100%;
	box-sizing: border-box;
	font-size: 0.85em;
}

aside .contacts {
	height: calc(100vh - 2.5em - 4em);
	padding: 8px;
	flex-flow: column;
}
aside .contacts .contact {
	display: flex;
	padding: 4px;
	border-radius: 4px;
	margin: 1px;
}
aside .contacts .contact:hover {
	cursor: pointer;
	background-color: #444;
}
aside .contacts .contact.active {
	background-color: #555;
}
aside .contacts .contact .unread {
	color: #e44;
	padding-left: 8px;
}

aside .user {
	background-color: #222;
	height: 4em;
	padding: 8px;
}
aside .user #username {
	text-align: center;
	margin: auto;
}

#sidebar-button {
	display: none;
	position: absolute;
	top: 32px;
	left: -4px;
	height: 32px;
	width: 48px;
	background-color: #78d;
	border-radius: 4px;
	border-left: none;
	padding: 8px;
	box-sizing: border-box;
}
#sidebar-button .icon-bar {
	display: none;
	width: 32px;
	background-color: #444;
	height: 2px;
	margin-bottom: 4px;
}
@media only screen and (max-device-width: 960px), (max-width: 640px) {
	#sidebar-button, #sidebar-button .icon-bar {
		display: block;
		cursor: pointer;
		z-index: 8;
	}
}
