

#chat-view {
	position: relative;
	height: 100%;
	overflow: hidden;
}

.dc-auth {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 24px;
}

.dc-auth-back {
	position: absolute;
	top: 18px;
	left: 18px;
}

.dc-auth-card {
	position: relative;
	max-width: 400px;
	width: 100%;
}

.dc-auth-card::before {
	content: "";
	position: absolute;
	top: -60px;
	left: 50%;
	z-index: -1;
	width: 280px;
	height: 280px;
	background: radial-gradient(circle, var(--accent-soft), transparent 72%);
	transform: translateX(-50%);
	pointer-events: none;
}

.dc-auth-card .panel-desc {
	margin: 6px 0 22px;
	text-align: center;
}

.chat-auth-tabs {
	display: flex;
	gap: 6px;
	padding: 4px;
	margin-bottom: 22px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
}

.chat-auth-tab {
	flex: 1;
	padding: 10px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--text-dim);
	background: none;
	border: none;
	border-radius: 7px;
	cursor: pointer;
	transition: all var(--ease);
}

.chat-auth-tab.active {
	color: var(--accent-contrast);
	background: var(--accent);
	box-shadow: var(--shadow);
}

#chat-auth-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.chat-remember-row {
	padding: 4px 0;
	border-bottom: none;
}

.chat-account-list {
	margin-top: 24px;
}

.chat-account-list-label {
	margin-bottom: 10px;
	font-size: 0.76rem;
	color: var(--text-faint);
}

.chat-account-chip {
	padding: 7px 13px;
	margin: 0 8px 8px 0;
	font-family: inherit;
	font-size: 0.8rem;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 99px;
	cursor: pointer;
	transition: all var(--ease);
}

.chat-account-chip:hover {
	color: var(--text);
	border-color: var(--accent-line);
}

.dc-app {
	display: grid;
	grid-template-columns: 72px 240px 1fr;
	height: 100%;
}

.dc-rail {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 12px 0;
	overflow-y: auto;
	background: var(--bg-deep);
	border-right: 1px solid var(--border);
}

.dc-rail-icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	color: var(--text-dim);
	cursor: pointer;
	background: var(--surface);
	border: none;
	border-radius: 16px;
	transition: border-radius var(--ease), background var(--ease), color var(--ease), transform var(--ease);
}

.dc-rail-icon svg {
	width: 20px;
	height: 20px;
}

.dc-rail-icon:hover {
	color: var(--accent-contrast);
	background: var(--accent);
	border-radius: 14px;
	transform: translateY(-1px);
}

.dc-rail-icon.active {
	color: var(--accent-contrast);
	background: var(--accent);
	border-radius: 14px;
	box-shadow: 0 0 0 2px var(--accent-line);
}

.dc-rail-sep {
	width: 28px;
	height: 2px;
	margin: 2px 0;
	background: var(--border-strong);
	border-radius: 2px;
}

.dc-rail-rooms {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 8px;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
}

.dc-rail-room {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	font-family: var(--font-script);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--accent);
	cursor: pointer;
	background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
	border: none;
	border-radius: 16px;
	transition: border-radius var(--ease), transform var(--ease), box-shadow var(--ease);
}

.dc-rail-room:hover {
	border-radius: 14px;
	transform: translateY(-1px);
}

.dc-rail-room.active {
	border-radius: 14px;
	box-shadow: 0 0 0 2px var(--accent);
}

.dc-add {
	color: var(--accent);
}

.dc-sidebar {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--surface);
	border-right: 1px solid var(--border);
}

.dc-search-btn {
	flex-shrink: 0;
	padding: 10px 12px;
	margin: 10px 10px 0;
	font-family: inherit;
	font-size: 0.8rem;
	color: var(--text-faint);
	text-align: left;
	cursor: pointer;
	background: var(--bg-deep);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	transition: border-color var(--ease);
}

.dc-search-btn:hover {
	border-color: var(--accent-line);
}

.dc-sidebar-scroll {
	flex: 1;
	min-height: 0;
	padding: 10px;
	overflow-y: auto;
}

.dc-nav-item {
	display: flex;
	gap: 10px;
	align-items: center;
	width: 100%;
	padding: 9px 10px;
	margin-bottom: 12px;
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-dim);
	text-align: left;
	cursor: pointer;
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	transition: background var(--ease), color var(--ease);
}

.dc-nav-item svg {
	width: 17px;
	height: 17px;
}

.dc-nav-item:hover {
	color: var(--text);
	background: var(--surface-2);
}

.dc-nav-item.active {
	color: var(--accent-contrast);
	background: var(--accent);
}

.dc-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	margin-left: auto;
	font-size: 0.68rem;
	font-weight: 700;
	color: #fff;
	background: var(--danger);
	border-radius: 99px;
}

.dc-section-label {
	padding: 0 6px;
	margin-bottom: 8px;
	font-size: 0.68rem;
	font-weight: 700;
	color: var(--text-faint);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.dc-section-row {
	display: flex;
	align-items: center;
	margin-top: 16px;
}

.dc-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 12px;
}

.dc-room-tabs {
	display: flex;
	gap: 4px;
	padding: 3px;
	margin-bottom: 10px;
	background: var(--bg-deep);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
}

.dc-room-tab {
	flex: 1;
	padding: 7px;
	font-family: inherit;
	font-size: 0.76rem;
	font-weight: 500;
	color: var(--text-dim);
	background: none;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all var(--ease);
}

.dc-room-tab.active {
	color: var(--accent-contrast);
	background: var(--accent);
}

.dc-user-bar {
	display: flex;
	flex-shrink: 0;
	gap: 8px;
	align-items: center;
	padding: 10px;
	background: var(--bg-deep);
	border-top: 1px solid var(--border);
}

.dc-user-avatar {
	width: 34px;
	height: 34px;
	font-size: 0.85rem;
}

.dc-user-info {
	flex: 1;
	min-width: 0;
}

.dc-user-name {
	overflow: hidden;
	font-size: 0.83rem;
	font-weight: 600;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dc-user-status {
	font-size: 0.7rem;
	color: var(--text-faint);
}

.dc-main {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	
	min-height: 0;
	height: 100%;
	overflow: hidden;
}

.dc-empty {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
}

.dc-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

.dc-content-header {
	display: flex;
	flex-shrink: 0;
	gap: 10px;
	align-items: center;
	padding: 14px 20px;
	font-weight: 600;
	border-bottom: 1px solid var(--border);
}

.dc-content-header svg {
	width: 18px;
	height: 18px;
	color: var(--accent);
}

.dc-friends-tabs {
	display: flex;
	gap: 6px;
	margin-left: 18px;
}

.dc-friends-tab {
	padding: 6px 12px;
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--text-dim);
	cursor: pointer;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 99px;
	transition: all var(--ease);
}

.dc-friends-tab:hover {
	color: var(--text);
	border-color: var(--accent-line);
}

.dc-friends-tab.active {
	color: var(--accent-contrast);
	background: var(--accent);
	border-color: transparent;
}

.dc-content-body {
	flex: 1;
	min-height: 0;
	padding: 18px 20px;
	overflow-y: auto;
}

.dc-friends-add {
	max-width: 480px;
	margin-bottom: 18px;
}

.dc-friends-add form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 12px;
}

.dc-friend-row {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 10px 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	transition: border-color var(--ease), background var(--ease);
}

.dc-friend-row:hover {
	border-color: var(--accent-line);
	background: var(--surface-2);
}

.dc-friend-row.clickable {
	cursor: pointer;
}

.dc-friend-name {
	flex: 1;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text);
}

.dc-friend-actions {
	display: flex;
	gap: 8px;
}

.dc-convo-header {
	display: flex;
	flex-shrink: 0;
	gap: 12px;
	align-items: center;
	padding: 11px 18px;
	border-bottom: 1px solid var(--border);
}

.dc-convo-headtext {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.dc-convo-headtext h3 {
	overflow: hidden;
	font-size: 0.98rem;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dc-mobile-back {
	display: none;
}

.dc-messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	min-height: 0;
	padding: 22px 18px;
	overflow-y: auto;
}

.dc-composer {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	gap: 10px;
	padding: 14px 18px;
	border-top: 1px solid var(--border);
}

.dc-composer-row {
	position: relative;
	display: flex;
	gap: 8px;
	align-items: center;
}

.dc-composer-input {
	flex: 1;
}

.dc-gif-btn {
	font-size: 0.72rem;
	font-weight: 700;
}

.dc-emoji-suggest {
	display: flex;
	flex-direction: column;
	max-height: 220px;
	padding: 6px;
	overflow-y: auto;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
}

.dc-emoji-suggest-item {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 7px 9px;
	font-family: inherit;
	font-size: 0.85rem;
	color: var(--text);
	text-align: left;
	cursor: pointer;
	background: none;
	border: none;
	border-radius: 7px;
}

.dc-emoji-suggest-item .emoji {
	font-size: 1.1rem;
}

.dc-emoji-suggest-item.active,
.dc-emoji-suggest-item:hover {
	background: var(--accent-soft);
}

.dc-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(3px);
}

.dc-modal {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 86vh;
}

.dc-modal-scroll {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-height: 86vh;
	overflow-y: auto;
}

.dc-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	background: var(--surface-2);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.dc-modal-close:hover {
	color: var(--text);
	background: var(--surface-3);
}

.dc-modal-scroll > .panel:first-child > h3 {
	padding-right: 36px;
}

.dc-profile-modal {
	max-width: 380px;
}

.dc-profile-panel {
	overflow: hidden;
}

.dc-profile-banner {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: calc(100% + 48px);
	height: 96px;
	margin: -24px -24px 0;
	padding-bottom: 8px;
	cursor: pointer;
	background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
	background-size: cover;
	background-position: center;
	border: none;
}

.dc-profile-banner-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

#dc-profile-banner-hint {
	position: relative;
	z-index: 1;
	padding: 4px 10px;
	font-size: 0.72rem;
	color: #fff;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 99px;
	opacity: 0;
	transition: opacity var(--ease);
}

.dc-profile-banner:hover #dc-profile-banner-hint {
	opacity: 1;
}

.dc-profile-edit-avatar {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
	margin: -32px 0 18px;
}

.dc-profile-edit-avatar .chat-avatar {
	position: relative;
	z-index: 1;
	width: 72px;
	height: 72px;
	font-size: 1.5rem;
	box-shadow: 0 0 0 4px var(--surface), 0 0 0 1px var(--accent-line) inset;
}

.dc-status-picker {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 16px;
}

.dc-status-option {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 0.84rem;
	color: var(--text-dim);
	text-align: left;
	cursor: pointer;
	background: none;
	border: none;
	border-radius: 7px;
	transition: background var(--ease), color var(--ease);
}

.dc-status-option:hover {
	background: var(--surface);
	color: var(--text);
}

.dc-status-option.active {
	color: var(--text);
	background: var(--accent-soft);
}

.dc-notify-row {
	margin-bottom: 16px;
}

.dc-status-dot {
	display: inline-block;
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.dot-online {
	background: #3ba55c;
}

.dot-idle {
	background: #faa61a;
}

.dot-dnd {
	background: #ed4245;
}

.dot-offline {
	background: var(--text-faint);
}

.chat-avatar-status {
	position: absolute;
	right: -1px;
	bottom: -1px;
	z-index: 2;
	width: 12px;
	height: 12px;
	background: var(--text-faint);
	border: 2px solid var(--surface);
	border-radius: 50%;
}

.chat-avatar-status.dot-online {
	background: #3ba55c;
}

.chat-avatar-status.dot-idle {
	background: #faa61a;
}

.chat-avatar-status.dot-dnd {
	background: #ed4245;
}

.chat-avatar-status.dot-offline {
	display: none;
}

.chat-avatar-sm .chat-avatar-status {
	width: 9px;
	height: 9px;
	border-width: 1.5px;
}

.dc-field-label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--text-dim);
}

.dc-bio-input {
	width: 100%;
	min-height: 80px;
	margin-bottom: 12px;
	font-family: inherit;
	resize: vertical;
}

.dc-gif-panel {
	position: absolute;
	right: 18px;
	bottom: 74px;
	z-index: 50;
	display: flex;
	flex-direction: column;
	width: 340px;
	height: 380px;
	padding: 10px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.dc-gif-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 8px;
}

.dc-gif-tab {
	flex: 1;
	padding: 7px;
	font-family: inherit;
	font-size: 0.78rem;
	color: var(--text-dim);
	cursor: pointer;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 7px;
}

.dc-gif-tab.active {
	color: var(--accent-contrast);
	background: var(--accent);
	border-color: transparent;
}

#dc-gif-search {
	margin-bottom: 8px;
}

.dc-gif-results {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.dc-gif-item {
	position: relative;
}

.dc-gif-item img {
	display: block;
	width: 100%;
	height: 90px;
	object-fit: cover;
	cursor: pointer;
	background: var(--surface);
	border-radius: 8px;
}

.dc-gif-fav-btn {
	position: absolute;
	top: 5px;
	right: 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	color: #fff;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.55);
	border: none;
	border-radius: 50%;
	opacity: 0;
	transition: opacity var(--ease), transform var(--ease);
}

.dc-gif-fav-btn svg {
	width: 13px;
	height: 13px;
}

.dc-gif-item:hover .dc-gif-fav-btn,
.dc-gif-fav-btn.on {
	opacity: 1;
}

.dc-gif-fav-btn:hover {
	transform: scale(1.12);
}

.dc-gif-fav-btn.on {
	color: gold;
}

.dc-gif-fav-btn.on svg {
	fill: gold;
}

.dc-gif-empty {
	grid-column: 1 / -1;
	padding: 20px;
	font-size: 0.8rem;
	color: var(--text-faint);
	text-align: center;
}

@media (max-width: 700px) {
	.dc-app {
		grid-template-columns: 60px 1fr;
	}

	.dc-sidebar {
		position: fixed;
		inset: 0 0 0 60px;
		z-index: 40;
	}

	.dc-main {
		position: fixed;
		inset: 0;
		z-index: 30;
		transform: translateX(100%);
		transition: transform var(--ease);
	}

	.dc-main.dc-main-active {
		transform: translateX(0);
	}

	.dc-mobile-back {
		display: flex;
	}

	
	.dc-composer {
		padding: 10px 12px;
	}

	.dc-composer-row {
		gap: 6px;
	}

	.dc-composer-row .ai-attach-btn {
		width: 38px;
		height: 38px;
	}

	.dc-composer-row .btn-primary {
		padding-left: 14px;
		padding-right: 14px;
	}

	.dc-messages {
		padding: 16px 12px;
	}

	.dc-content-body {
		padding: 14px 12px;
	}

	
	.chat-msg {
		max-width: 100%;
	}
}

.chat-avatar {
	position: relative;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	overflow: hidden;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--accent);
	background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
	border-radius: 50%;
	box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent-line) inset;
	transition: box-shadow var(--ease), transform var(--ease);
}

.chat-avatar img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.chat-avatar-btn {
	padding: 0;
	cursor: pointer;
	background: var(--accent-soft);
	border: none;
}

.chat-avatar-btn:hover {
	box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent) inset, 0 0 18px var(--accent-soft);
	transform: scale(1.04);
}

.chat-avatar-edit {
	position: absolute;
	inset: auto 0 0 0;
	padding: 3px 0;
	font-size: 0.6rem;
	font-weight: 600;
	color: #fff;
	text-align: center;
	background: rgba(0, 0, 0, 0.55);
	opacity: 0;
	transition: opacity var(--ease);
}

.chat-avatar-btn:hover .chat-avatar-edit {
	opacity: 1;
}

.chat-avatar-sm {
	width: 30px;
	height: 30px;
	font-size: 0.72rem;
	box-shadow: 0 0 0 2px var(--accent-soft);
}

.chat-room-empty {
	padding: 20px;
	font-size: 0.85rem;
	color: var(--text-faint);
	text-align: center;
	background: var(--surface);
	border: 1px dashed var(--border);
	border-radius: var(--radius-sm);
}

.chat-room-row {
	position: relative;
	display: flex;
	gap: 13px;
	align-items: center;
	width: 100%;
	padding: 13px 16px;
	overflow: hidden;
	font-family: inherit;
	text-align: left;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: transform var(--ease), border-color var(--ease), background var(--ease), box-shadow var(--ease);
}

.chat-room-row::before {
	content: "";
	position: absolute;
	top: 0;
	right: var(--radius-sm);
	left: var(--radius-sm);
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.chat-room-row:hover {
	border-color: var(--accent-line);
	background: var(--surface-2);
	box-shadow: var(--shadow);
	transform: translateY(-2px);
}

.chat-room-icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	font-family: var(--font-script);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--accent);
	background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
	border-radius: 11px;
	box-shadow: 0 0 0 1px var(--accent-line) inset;
}

.chat-room-row-text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.chat-room-row-tags {
	display: flex;
	gap: 6px;
	align-items: center;
}

.chat-room-row-name {
	overflow: hidden;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.chat-room-lock {
	padding: 3px 9px;
	font-size: 0.72rem;
	color: var(--text-faint);
	background: var(--bg-deep);
	border-radius: 99px;
}

.chat-room-mine {
	padding: 3px 9px;
	font-size: 0.72rem;
	color: var(--accent);
	background: var(--accent-soft);
	border-radius: 99px;
}


.dc-room-notify {
	margin-left: auto;
}

.dc-room-notify.on {
	color: var(--accent);
}

.dc-room-notify.on svg {
	fill: var(--accent-soft);
}

.chat-room-settings {
	margin-left: 4px;
}

.chat-room-menu {
	position: fixed;
	z-index: 500;
	display: flex;
	flex-direction: column;
	width: 190px;
	padding: 6px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	animation: rise 0.15s ease;
}

.chat-room-menu-item {
	padding: 9px 11px;
	font-family: inherit;
	font-size: 0.84rem;
	color: var(--text);
	text-align: left;
	background: none;
	border: none;
	border-radius: 7px;
	cursor: pointer;
	transition: background var(--ease);
}

.chat-room-menu-item:hover {
	background: var(--surface);
}

.chat-room-menu-item.danger {
	color: var(--danger);
}

.chat-room-row-by {
	font-size: 0.76rem;
	color: var(--text-faint);
}

.chat-form-panel {
	margin-bottom: 20px;
}

.chat-form-panel h3 {
	margin-bottom: 4px;
}

.chat-form-panel form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 14px;
}

.chat-room-sub {
	font-size: 0.76rem;
	color: var(--text-faint);
}

.chat-msg {
	display: flex;
	flex-shrink: 0;
	gap: 11px;
	width: 100%;
	max-width: 720px;
	margin-bottom: 20px;
	animation: rise 0.22s ease;
}

.chat-msg-col {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	max-width: 520px;
}

.chat-msg-self .chat-msg-col {
	align-items: flex-end;
}

.chat-msg-meta {
	margin-bottom: 4px;
	font-size: 0.74rem;
	color: var(--text-faint);
}

.chat-msg-body {
	display: inline-block;
	max-width: 100%;
	padding: 10px 14px;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--text);
	word-wrap: break-word;
	white-space: pre-wrap;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px 16px 16px 5px;
	box-shadow: var(--shadow);
}

.chat-msg-image {
	display: block;
	max-width: min(320px, 100%);
	margin-top: 6px;
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: var(--shadow);
}

.chat-msg-image:first-child {
	margin-top: 0;
}

.chat-msg-self {
	flex-direction: row-reverse;
	text-align: right;
}

.chat-msg-self .chat-msg-body {
	color: var(--accent-contrast);
	text-align: left;
	background: linear-gradient(150deg, var(--accent), var(--accent-strong));
	border-color: transparent;
	border-radius: 16px 16px 5px 16px;
}

.chat-msg-broken {
	font-style: italic;
	color: var(--text-faint);
	background: var(--surface) !important;
}

.chat-msg-receipt {
	margin-top: 4px;
	font-size: 0.7rem;
	color: var(--text-faint);
}

.chat-msg-pending {
	opacity: 0.6;
}

.chat-attach-preview {
	position: relative;
	display: inline-flex;
	width: fit-content;
	padding: 6px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

.chat-attach-preview img {
	display: block;
	max-height: 90px;
	border-radius: 8px;
}

.chat-attach-remove {
	position: absolute;
	top: -7px;
	right: -7px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	font-size: 0.9rem;
	line-height: 1;
	color: var(--text);
	cursor: pointer;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 50%;
}

