/*Republic Chat — веб-чат*/

.rc-app {
	background: var(--rc-card);
	border-radius: 16px;
	box-shadow: 0 2px 10px rgba(23,33,43,.07);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 640px;
	max-height: 78vh;
}

.rc-topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #17212B;
	color: #fff;
	flex: none;
}
.rc-topbar .rc-title { font-weight: 700; flex: 1; min-width: 0; }
.rc-topbar .rc-title small { display: block; font-weight: 400; color: rgba(255,255,255,.6); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-topbar button {
	background: rgba(255,255,255,.12);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 7px 12px;
	font-size: 13px;
	cursor: pointer;
}
.rc-topbar button:hover { background: rgba(255,255,255,.22); }
.rc-me { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.rc-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #2AABEE;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	flex: none;
	overflow: hidden;
}
.rc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rc-avatar.rc-sm { width: 24px; height: 24px; font-size: 12px; }
.rc-avatar.rc-lg { width: 56px; height: 56px; font-size: 24px; }

/* --- авторизация --- */
.rc-auth { margin: auto; width: 100%; max-width: 360px; padding: 28px; text-align: center; }
.rc-auth h2 { margin: 0 0 4px; }
.rc-auth .rc-sub { color: #5B6B76; font-size: 14px; margin: 0 0 18px; }
.rc-tabs { display: flex; gap: 4px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.rc-tabs button {
	border: 0; background: transparent; padding: 8px 12px; border-radius: 8px;
	cursor: pointer; font-size: 14px; color: #5B6B76;
}
.rc-tabs button.rc-active { background: rgba(42,171,238,.14); color: #1B8AC0; font-weight: 700; }
.rc-field { margin-bottom: 10px; text-align: left; }
.rc-field label { display: block; font-size: 13px; color: #5B6B76; margin-bottom: 4px; }
.rc-field input {
	width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid #D5DEE5;
	border-radius: 10px; font-size: 15px;
}
.rc-field input:focus { outline: 2px solid rgba(42,171,238,.4); border-color: #2AABEE; }
.rc-btn {
	display: inline-block; background: #2AABEE; color: #fff; border: 0; border-radius: 10px;
	padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
}
.rc-btn:hover { background: #1B8AC0; }
.rc-btn[disabled] { opacity: .6; cursor: default; }
.rc-error { color: #D32F2F; font-size: 13px; margin: 8px 0 0; min-height: 16px; text-align: left; }
.rc-ok { color: #2E7D32; font-size: 13px; margin: 8px 0 0; min-height: 16px; text-align: left; }

/* --- списки --- */
.rc-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.rc-row {
	display: flex; gap: 12px; align-items: center; padding: 10px 16px; cursor: pointer;
	border-bottom: 1px solid #F0F4F7;
}
.rc-row:hover { background: #F4F9FC; }
.rc-row-main { flex: 1; min-width: 0; }
.rc-row-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-row-name .rc-tag {
	font-size: 11px; color: #1B8AC0; background: rgba(42,171,238,.14);
	border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px;
}
.rc-row-preview { color: #5B6B76; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-row-side { text-align: right; flex: none; }
.rc-row-time { color: #8CA0AC; font-size: 12px; }
.rc-unread {
	display: inline-block; background: #2AABEE; color: #fff; border-radius: 999px;
	font-size: 12px; font-weight: 700; padding: 1px 8px; margin-top: 4px;
}
.rc-empty { text-align: center; color: #5B6B76; padding: 60px 20px; }
.rc-fabbar { padding: 12px 16px; border-top: 1px solid #F0F4F7; flex: none; display: flex; gap: 10px; }
.rc-fabbar .rc-btn { width: auto; }
.rc-mini-form { padding: 12px 16px; border-top: 1px solid #F0F4F7; background: #F8FBFD; }
.rc-mini-form .rc-inline { display: flex; gap: 8px; }
.rc-mini-form input[type="text"], .rc-mini-form input[type="password"] {
	flex: 1; padding: 10px 12px; border: 1px solid #D5DEE5; border-radius: 10px; font-size: 14px;
}
.rc-check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: #5B6B76; margin: 10px 0; }

/* --- сообщения --- */
.rc-msg { display: flex; margin: 3px 12px; }
.rc-msg.rc-mine { justify-content: flex-end; }
.rc-bubble {
	max-width: 78%;
	background: #F1F1F1;
	border-radius: 14px;
	padding: 8px 12px 5px;
	box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.rc-mine .rc-bubble { background: #DFF3FC; }
.rc-bubble .rc-author { color: #1B8AC0; font-weight: 600; font-size: 13px; display: flex; gap: 6px; align-items: center; margin-bottom: 2px; }
.rc-bubble .rc-text { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.rc-bubble .rc-time { font-size: 11px; color: #8CA0AC; text-align: right; margin-top: 2px; }
.rc-img { max-width: 260px; max-height: 220px; border-radius: 10px; display: block; cursor: pointer; margin: 4px 0; }
.rc-file { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.rc-file a { color: #1B8AC0; font-weight: 600; word-break: break-all; }
.rc-file .rc-size { color: #8CA0AC; font-size: 12px; }
.rc-audio { padding: 4px 0; }
.rc-audio audio { width: 240px; max-width: 100%; height: 36px; }

/* --- composer --- */
.rc-composer { flex: none; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #F0F4F7; align-items: flex-end; }
.rc-composer textarea {
	flex: 1; resize: none; border: 1px solid #D5DEE5; border-radius: 20px;
	padding: 10px 14px; font-size: 14.5px; font-family: inherit; max-height: 120px;
}
.rc-composer textarea:focus { outline: 2px solid rgba(42,171,238,.4); }
.rc-attach {
	width: 42px; height: 42px; border-radius: 50%; border: 0; background: #EDF3F8;
	font-size: 18px; cursor: pointer; flex: none;
}
.rc-attach:hover { background: #DCEBF5; }
.rc-send {
	width: 42px; height: 42px; border-radius: 50%; border: 0; background: #2AABEE; color: #fff;
	font-size: 16px; cursor: pointer; flex: none;
}
.rc-send:hover { background: #1B8AC0; }
.rc-sending { color: #8CA0AC; font-size: 12px; padding: 0 16px 8px; }

/* --- lightbox --- */
.rc-lightbox {
	position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 9999;
	display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 20px;
}
.rc-lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }

@media (max-width: 640px) {
	.rc-app { min-height: 72vh; max-height: none; }
	.rc-bubble { max-width: 88%; }
}

/* --- v1.1.0: галочки, реакции, профили --- */
.rc-msgwrap { max-width: 80%; display: flex; flex-direction: column; align-items: flex-start; }
.rc-mine .rc-msgwrap { align-items: flex-end; }
.rc-bubble { max-width: 100%; }
.rc-under { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 2px; min-height: 24px; }
.rc-react-btn {
	border: 0; background: #FFFFFF; color: #1B1B1B; border-radius: 999px;
	padding: 2px 9px; font-size: 14px; cursor: pointer; opacity: 0;
	box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: opacity .15s ease;
}
.rc-msg:hover .rc-react-btn { opacity: 1; }
@media (hover: none) { .rc-react-btn { opacity: 1; } }
.rc-chip {
	border: 1px solid #E1E8EE; background: #F4F8FB; border-radius: 999px;
	padding: 2px 9px; font-size: 13px; cursor: pointer;
}
.rc-chip.rc-mine-react { background: rgba(42,171,238,.16); border-color: #2AABEE; }
.rc-reacts { display: flex; gap: 4px; flex-wrap: wrap; }
.rc-time { display: inline-flex; align-items: center; }
.rc-tick { font-size: 10px; margin-left: 4px; letter-spacing: -1px; color: #9AAEBB; user-select: none; }
.rc-tick.rc-read { color: #2AABEE; }
.rc-profile {
	position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9998;
	display: flex; align-items: center; justify-content: center; padding: 20px;
}
.rc-profile-card {
	background: #fff; border-radius: 18px; padding: 30px 34px; text-align: center;
	min-width: 280px; max-width: 340px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.rc-profile-card .rc-avatar.rc-lg { width: 84px; height: 84px; font-size: 34px; margin: 0 auto 10px; }
.rc-profile-card h3 { margin: 0 0 4px; }
.rc-profile-card p { margin: 0 0 18px; color: #5B6B76; font-size: 14px; }
.rc-profile-close {
	position: absolute; top: 10px; right: 12px; border: 0; background: transparent;
	font-size: 16px; cursor: pointer; color: #5B6B76;
}

/* --- v1.2.0: ответы, изменение, закреп --- */
.rc-quote {
	background: rgba(42,171,238,.10);
	border-left: 3px solid #2AABEE;
	border-radius: 6px;
	padding: 4px 8px;
	margin: 2px 0 4px;
	max-width: 100%;
}
.rc-quote-author {
	color: #1B8AC0; font-weight: 600; font-size: 12.5px;
}
.rc-quote-text {
	color: #5B6B76; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-edited { color: #9AAEBB; font-size: 10px; margin-left: 3px; }
.rc-pinned {
	display: none;
	background: rgba(42,171,238,.10);
	border-bottom: 1px solid rgba(42,171,238,.25);
	padding: 8px 16px;
	font-size: 13.5px;
	color: #1B1B1B;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rc-rt { font-size: 11px; opacity: .7; white-space: nowrap; }
