.chat-body {
	position: fixed;
	top: 0;
	left: 0;
	height: 100%;
}
#chat {
	background: #fff;
	max-width: 1040px;
	border-left: 1px solid #ccc;
	border-right: 1px solid #ccc;
	margin: 0 auto;
	height: calc(100% - 54px);
	position: relative;
}
.darkmode #chat {
	border-color: #666;
	background: #333;
	height: calc(100% - 55px);
}
.chat-btn {
	position: absolute;
	height: 60px;
	line-height: 60px;
	padding: 0 25px;
	cursor: pointer;
	color: #00bff3;
	font-size: 13px;
	text-align: center;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}
.chat-btn:active {
	background: #00bff3;
	color: #fff;
}

/* Logged out intro screen */
#chat-intro {
	margin: 0 20px;
}
#chat-intro-msg {
	font-size: 15px;
}
#chat-login-btn {
	display: block;
	margin: 20px 0;
}

/* List of Chats */
#chat-list {
	float: left;
	width: 300px;
	height: 100%;
	border-right: 1px solid #ccc;
	background: #fff;
	position: relative;
	z-index: 2;
}
.darkmode #chat-list {
	background: #333;
	border-color: #666;
}
#chat-panel {
	position: relative;
	height: 60px;
	border-bottom: 1px solid #ccc;
}
.darkmode #chat-panel {
	border-color: #666;
}
#chat-settings-btn {
	width: 26px;
	height: 26px;
	padding: 17px 27px;
	cursor: pointer;
	position: absolute;
	top: 0;
	left: 0;
	fill: #aaa;
}
.darkmode #chat-settings-btn {
	fill: #777;
}
#chat-logo {
	position: absolute;
	top: 0;
	left: 50%;
	width: 100px;
	margin-left: -50px;
	line-height: 60px;
	color: #ccc;
	text-align: center;
	font-size: 13px;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}
.darkmode #chat-logo {
	color: #666;
}
#chat-logo-cat {
	position: absolute;
	top: 0;
	left: 50%;
	margin-left: -16px;
	width: 32px;
	opacity: 0;
	transform: translateY(-100%);
	transition: opacity 0.5s, transform 0.5s;
}
#chat-logo .h {
	transition: font-size 0.5s;
}
.memecat .h {
	font-size: 0;
}
.memecat #chat-logo-cat {
	opacity: 1;
	transform: translateY(0);
}
#chat-beta {
	position: absolute;
	top: 40px;
	left: 0;
	width: 100%;
	text-align: center;
	font-size: 8px;
	color: #ccc;
	pointer-events: none;
}
.darkmode #chat-beta {
	color: #666;
}
#chat-new-btn {
	right: 0;
	top: 0;
}
#chat-chats {
	overflow-y: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	height: calc(100% - 61px);
}
#chat-chats::-webkit-scrollbar {
	display: none;
}
.chat {
	height: 30px;
	padding: 10px 15px;
	cursor: pointer;
	position: relative;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}
.chat + .chat {
	border-top: 1px solid #ccc;
}
.darkmode .chat + .chat {
	border-color: #666;
}
.chat:active {
	background: #00bff3;
	color: #fff;
}
.chat:active .chat-list-msg {
	color: #fff;
}
.chat.unread {
	background: #f0f0f0;
}
.darkmode .chat.unread {
	background: #222;
}
.chat.unread:active {
	background: #00bff3;
}
.chat .ico {
	float: left;
	width: 30px;
	height: 30px;
	border-radius: 3px;
	overflow: hidden;
	margin-right: 10px;
}
.chat-list-username {
	line-height: 17px;
	white-space: nowrap;
	overflow: hidden;
}
.chat-list-time {
	float: right;
	font-size: 10px;
	color: #ccc;
	margin-left: 5px;
}
.darkmode .chat-list-time {
	color: #666;
}
.chat-list-msg {
	color: #999;
	font-size: 12px;
	line-height: 13px;
	white-space: nowrap;
	overflow: hidden;
}
.chat-list-meme {
	display: inline-block;
	width: 12px;
	height: 12px;
	margin: 1px 3px 0 0;
}
.chat-list-meme img {
	width: 100%;
	height: 100%;
	border-radius: 3px;
}


#chat-settings {
	position: absolute;
	top: 61px;
	left: 0;
	width: 100%;
	height: calc(100% - 61px);
	padding: 20px;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	background: #fff;
}
.darkmode #chat-settings {
	background: #333;
}
.chat-tip {
	color: #999;
	margin-top: 20px;
}

/* Search for a new chat */
#chat-new {
	position: absolute;
	top: 60px;
	left: 0;
	width: 100%;
	height: calc(100% - 60px);
	background: #fff;
}
.darkmode #chat-new {
	background: #333;
}
#chat-new-search {
	display: block;
	width: calc(100% + 2px);
	max-width: none;
	margin: 0 -1px;
	height: 60px;
	padding: 19px 15px;
}
#chat-new-list {
	position: absolute;
	top: 60px;
	left: 0;
	width: 100%;
	height: calc(100% - 60px);
	background: #fff;
	overflow-y: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.darkmode #chat-new-list {
	background: #333;
}
#chat-new-list::-webkit-scrollbar {
	display: none;
}
.chat-new-result {
	height: 30px;
	padding: 10px 15px;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}
.chat-new-result:active {
	background: #00bff3;
	color: #fff;
}
.chat-new-result + .chat-new-result {
	border-top: 1px solid #ccc;
}
.darkmode .chat-new-result + .chat-new-result {
	border-color: #666;
}
.chat-new-result .ico {
	float: left;
	border-radius: 3px;
	width: 30px;
	height: 30px;
}
.chat-new-result-username {
	line-height: 30px;
	margin-left: 40px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.chat-new-no-results {
	text-align: center;
	color: #999;
	padding: 10px 15px;
	line-height: 30px;
}
#chat-new-or {
	padding: 22px 0 0;
	text-align: center;
	color: #999;
	font-size: 11px;
}
#chat-new-invite-btn {
	margin: 10px auto;
	width: 160px;
	padding: 10px 0;
	cursor: pointer;
	color: #00bff3;
	text-align: center;
	font-size: 13px;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}
.chat-invite-popup {
	width: 340px;
	padding: 20px;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	max-width: 100%;
}
.chat-invite-msg {
	margin: 0 0 20px;
	text-align: center;
}
input.chat-invite-link {
	width: 100%;
}
.chat-invite-share-btn,
.chat-invite-accept-btn {
	margin-top: 20px;
	display: block;
}

/* Main chat conversation currently selected */
#chat-main {
	position: relative;
	margin-left: 300px;
	height: 100%;
	margin-right: -1px;
}
#chat-loading {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(240, 240, 240, 0.75);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.1s;
	z-index: 2;
}
.darkmode #chat-loading {
	background: rgba(34, 34, 34, 0.75);
}
#chat-loading.show {
	opacity: 1;
	pointer-events: initial;
}
#chat-loading .load {
	position: absolute;
	left: 50%;
	top: 50%;
	margin: -25px 0 0 -25px;
}
#chat-main-title {
	height: 60px;
	line-height: 60px;
	padding: 0 25px;
	overflow: hidden;
}
#chat-main-title a {
	color: inherit;
}
#chat-main-title a:hover {
	text-decoration: none;
}
#chat-list-btn {
	left: 0;
	top: 0;
	display: none;
}
#chat-msgs {
	margin: 0 1px;
	height: calc(100% - 180px);
	overflow-y: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
#chat-msgs::-webkit-scrollbar {
	display: none;
}
.chat-msg {
	padding: 10px 15px;
	line-height: 19px;
	min-height: 19px;
	position: relative;
}
.chat-msg.same-user {
	padding-top: 0;
}
.chat-msg:last-child {
	margin-bottom: 10px;
}
.chat-msg.deleting:after {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	content: ' ';
	background: rgba(240, 240, 240, 0.75);
}
.darkmode .chat-msg.deleting:after {
	background: rgba(34, 34, 34, 0.75);
}
.chat-no-msgs-yet {
	padding: 15px;
	line-height: 19px;
	color: #999;
	text-align: center;
}
.chat-msg .ico {
	float: left;
	border-radius: 3px;
	cursor: pointer;
	width: 25px;
	height: 25px;
}
.chat-msg-title {
	font-size: 13px;
	color: #999;
	margin-left: 34px;
}
.chat-msg-username {
	display: inline-block;
	vertical-align: top;
	overflow: hidden;
	max-width: 85%; /* small enough to not overflow msg-time on 320px iphone */
}
.same-user .ico,
.same-user .chat-msg-title {
	display: none;
}
.chat-msg-text {
	margin-left: 34px;
	word-wrap: break-word;
}
.chat-msg-time {
	font-size: 10px;
	color: #ccc;
	padding-left: 10px;
}
.darkmode .chat-msg-time {
	color: #666;
}
.chat-meme + .chat-msg-time {
	padding-left: 0;
}
.chat-msg-memes {
	margin: 10px 0 -10px 34px;
}
.same-user .chat-msg-title + .chat-msg-memes {
	margin-top: 0;
}
.chat-msg .chat-meme {
	transition: transform 0.3s;
}
.chat-msg-deleted {
	color: #999;
	margin-left: 34px;
}
.chat-msg-menu {
	position: absolute;
	left: 46px;
	top: 0;
	border: 1px solid #ccc;
	box-shadow: 0 0 3px #ccc;
	border-radius: 3px;
	overflow: hidden;
	z-index: 1;
}
.darkmode .chat-msg-menu {
	border-color: #666;
	box-shadow: 0 0 3px #666;
}
.chat-msg-menu.near-bottom {
	top: initial;
	bottom: calc(100% - 40px);
}
.chat-msg-btn {
	cursor: pointer;
	padding: 10px 15px;
	background: #fff;
	display: block;
	color: inherit;
	height: 20px;
	line-height: 20px;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}
.darkmode .chat-msg-btn {
	background: #333;
}
.chat-msg-btn:hover {
	text-decoration: none;
}
.chat-msg-btn:active {
	background: #00bff3;
	color: #fff;
}
#chat-send-panel {
	position: absolute;
	bottom: 0;
	width: 100%;
}
#chat-memes-wrap {
	position: relative;
	margin: 0 1px;
	transform: translateY(0);
	transition: transform 0.5s;
}
#chat-memes-wrap.expanded {
	transform: translateY(-250px);
}
#chat-memes {
	padding: 10px 0 0 10px;
	overflow: hidden;
	height: 300px;
	margin-bottom: -250px;
	background: #fff;
	border-top: 1px solid #ccc;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.darkmode #chat-memes {
	background: #333;
	border-color: #666;
}
#chat-memes::-webkit-scrollbar {
	display: none;
}
.expanded #chat-memes {
	overflow-y: auto;
}
@media (max-height: 484px) {
	#chat-memes-wrap.expanded {
		transform: translateY(-150px);
	}
	#chat-memes {
		height: 200px;
		margin-bottom: -150px;
	}
}
.chat-meme {
	display: inline-block;
	vertical-align: top;
	width: 40px;
	height: 40px;
	border-radius: 3px;
	overflow: hidden;
	cursor: pointer;
	margin: 0 10px 10px 0;
	transform-origin: bottom;
}
.chat-meme.selected {
	box-shadow: 0 0 0 3px #00bff3;
}
.chat-meme img {
	width: 100%;
	height: 100%;
	vertical-align: top;
}
.chat-meme.near-top {
	transform-origin: top;
}
.chat-meme.zoom {
	transform: scale(3);
}
#chat-memes-more-btn {
	right: 0;
	top: 1px;
	background: #fff;
}
.darkmode #chat-memes-more-btn {
	background: #333;
}
#chat-memes-more-btn:active {
	background: #00bff3;
}
.expanded #chat-memes-more-btn {
	top: -60px;
}
#chat-memes-added {
	position: absolute;
	bottom: 100%;
	left: 0;
	padding: 10px 0 0 90px;
	background: #fff;
	border-radius: 0 3px 0 0;
	border: solid #ccc;
	border-width: 1px 1px 0 0;
}
.darkmode #chat-memes-added {
	background: #333;
	border-color: #666;
}
#chat-memes-added-label {
	position: absolute;
	left: 20px;
	top: 0;
	height: 60px;
	line-height: 60px;
	color: #999;
}
#chat-input {
	display: block;
	width: 100%;
	height: 60px;
	line-height: 20px;
	min-height: 60px;
	max-height: 120px;
	padding: 19px 90px 19px 15px;
	resize: none;
	position: relative;
	z-index: 1;
}
#chat-input:focus {
	z-index: 2; /* left border must overlay chat-list on desktop screens */
}
#chat-input:focus + #chat-send-btn {
	z-index: 2;
}
#chat-input.no-events {
	background: #f0f0f0;
}
.darkmode #chat-input.no-events {
	background: #222;
}
#chat-send-btn {
	bottom: 0;
	right: 0;
	width: 40px;
	z-index: 1;
}

@media (max-width: 1040px) {
	#chat {
		border: none;
	}
	#chat-new-search {
		width: calc(100% + 1px);
		margin-left: 0;
	}
	#chat-main {
		margin-right: 0;
	}
}

@media (max-width: 768px) {
	#chat-new-search {
		width: 100%;
		margin-right: 0;
	}
	#chat-list {
		border: none;
		position: absolute;
		transform: translateX(-100%);
		transition: transform 0.2s;
		width: 100%;
	}
	#chat-list.active {
		transform: translateX(0);
	}
	#chat-main {
		margin-left: 0;
	}
	#chat-main-title {
		padding: 0 25px 0 95px;
	}
	#chat-list-btn {
		display: block;
	}
	#chat-msgs {
		margin: 0;
	}
	#chat-memes-wrap {
		margin: 0;
	}
	#chat-input {
		border-width: 1px 0;
	}
}