.wtc-app {
	--wtc-bg: #ffffff;
	--wtc-sidebar-bg: #f4f4f6;
	--wtc-text: #1d1c1d;
	--wtc-muted: #6b6b6b;
	--wtc-border: #e0e0e2;
	--wtc-accent: #4a154b;
	--wtc-accent-light: #eee6ef;
	--wtc-bubble: #f0f0f2;

	display: flex;
	border: 1px solid var(--wtc-border);
	border-radius: 8px;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: var(--wtc-bg);
	color: var(--wtc-text);
}

.wtc-app[data-theme="dark"] {
	--wtc-bg: #1a1d21;
	--wtc-sidebar-bg: #19171d;
	--wtc-text: #f4f4f6;
	--wtc-muted: #a3a3a6;
	--wtc-border: #2f3136;
	--wtc-accent: #9b6fb0;
	--wtc-accent-light: #2b2530;
	--wtc-bubble: #26282c;
}

.wtc-app * { box-sizing: border-box; }

.wtc-sidebar {
	width: 240px;
	background: var(--wtc-sidebar-bg);
	border-right: 1px solid var(--wtc-border);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}

.wtc-sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px;
	font-weight: 700;
	border-bottom: 1px solid var(--wtc-border);
}

.wtc-sidebar-section { padding: 10px 14px; }

.wtc-sidebar-title {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--wtc-muted);
	margin-bottom: 6px;
}

.wtc-list { list-style: none; margin: 0; padding: 0; }

.wtc-list li {
	padding: 6px 8px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wtc-list li:hover { background: var(--wtc-accent-light); }
.wtc-list li.active { background: var(--wtc-accent); color: #fff; }

.wtc-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.wtc-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid var(--wtc-border);
}

.wtc-target-name { font-weight: 700; font-size: 16px; }

.wtc-topbar-actions { display: flex; align-items: center; gap: 8px; }

.wtc-search-input, .wtc-message-input {
	background: var(--wtc-bubble);
	border: 1px solid var(--wtc-border);
	border-radius: 6px;
	padding: 8px 10px;
	color: var(--wtc-text);
	font-size: 14px;
}

.wtc-search-input { width: 200px; }

.wtc-icon-btn {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	position: relative;
	padding: 4px 8px;
	border-radius: 4px;
	color: var(--wtc-text);
}
.wtc-icon-btn:hover { background: var(--wtc-accent-light); }

.wtc-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	background: #e01e5a;
	color: #fff;
	border-radius: 50%;
	font-size: 10px;
	padding: 1px 5px;
}

.wtc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
}

.wtc-msg {
	display: flex;
	gap: 10px;
	padding: 6px 0;
}

.wtc-msg img.wtc-avatar {
	width: 36px;
	height: 36px;
	border-radius: 6px;
	flex-shrink: 0;
}

.wtc-msg-body { flex: 1; min-width: 0; }

.wtc-msg-meta {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 2px;
}

.wtc-msg-sender { font-weight: 700; font-size: 14px; }
.wtc-msg-time { font-size: 11px; color: var(--wtc-muted); }
.wtc-msg-content { font-size: 14px; line-height: 1.4; word-break: break-word; }

.wtc-msg-actions {
	display: none;
	gap: 6px;
	font-size: 12px;
	margin-top: 4px;
}
.wtc-msg:hover .wtc-msg-actions { display: flex; }
.wtc-msg-actions span { cursor: pointer; color: var(--wtc-muted); }
.wtc-msg-actions span:hover { color: var(--wtc-accent); }

.wtc-reactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.wtc-reaction-pill {
	background: var(--wtc-bubble);
	border: 1px solid var(--wtc-border);
	border-radius: 12px;
	padding: 1px 8px;
	font-size: 12px;
	cursor: pointer;
}
.wtc-reaction-pill.mine { border-color: var(--wtc-accent); background: var(--wtc-accent-light); }

.wtc-file-attachment {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--wtc-bubble);
	border: 1px solid var(--wtc-border);
	border-radius: 6px;
	padding: 8px 10px;
	margin-top: 4px;
	font-size: 13px;
	text-decoration: none;
	color: var(--wtc-text);
}

.wtc-composer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid var(--wtc-border);
}

.wtc-message-input { flex: 1; }

.wtc-send-btn {
	background: var(--wtc-accent);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 8px 16px;
	cursor: pointer;
	font-weight: 600;
}
.wtc-send-btn:hover { opacity: .9; }

.wtc-notif-panel {
	position: absolute;
	top: 50px;
	right: 16px;
	width: 320px;
	max-height: 400px;
	overflow-y: auto;
	background: var(--wtc-bg);
	border: 1px solid var(--wtc-border);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,.15);
	padding: 10px;
	z-index: 50;
}

.wtc-hidden { display: none !important; }

.wtc-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.4);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
}

.wtc-modal-content {
	background: var(--wtc-bg);
	border-radius: 8px;
	padding: 20px;
	width: 360px;
	max-width: 90%;
}

.wtc-modal-content h3 { margin-top: 0; }

.wtc-modal-content input[type="text"] {
	width: 100%;
	padding: 8px;
	margin-bottom: 10px;
	border-radius: 6px;
	border: 1px solid var(--wtc-border);
	background: var(--wtc-bubble);
	color: var(--wtc-text);
}

.wtc-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.wtc-btn {
	padding: 8px 14px;
	border-radius: 6px;
	border: 1px solid var(--wtc-border);
	background: var(--wtc-bubble);
	color: var(--wtc-text);
	cursor: pointer;
}
.wtc-btn-primary { background: var(--wtc-accent); color: #fff; border: none; }

.wtc-login-notice { padding: 20px; text-align: center; color: #888; }

.wtc-user-pick-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px;
	cursor: pointer;
	border-radius: 4px;
}
.wtc-user-pick-item:hover { background: var(--wtc-accent-light); }
.wtc-user-pick-item img { width: 24px; height: 24px; border-radius: 4px; }

@media (max-width: 700px) {
	.wtc-app { flex-direction: column; height: auto !important; }
	.wtc-sidebar { width: 100%; max-height: 200px; }
	.wtc-search-input { width: 120px; }
}
