/**
 * Chat AI — Fullscreen chat interface styles.
 *
 * Colors use CSS custom properties from user's WP admin color scheme.
 *
 * @package MCPCOMAL
 * @since   1.1.0
 */

/* ─── Reset & Container ───────────────────────────────────────── */

#mcpcomal-chat-app {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--mcpcomal-chat-text);
	background: var(--mcpcomal-chat-bg-main);
}

#mcpcomal-chat-app *,
#mcpcomal-chat-app *::before,
#mcpcomal-chat-app *::after {
	box-sizing: border-box;
}

#mcpcomal-chat-app textarea:focus,
#mcpcomal-chat-app input:focus {
	outline: none;
	box-shadow: none;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */

.mcpcomal-chat-sidebar {
	width: 260px;
	min-width: 260px;
	background: var(--mcpcomal-chat-bg-sidebar);
	color: var(--mcpcomal-chat-sidebar-text);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.mcpcomal-chat-sidebar-header {
	padding: 12px;
}

.mcpcomal-chat-new-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 10px 16px;
	background: var(--mcpcomal-chat-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: opacity 0.2s;
}

.mcpcomal-chat-new-btn:hover {
	opacity: 0.9;
}

/* Sidebar nav tabs */

.mcpcomal-chat-sidebar-nav {
	display: flex;
	padding: 0 12px;
	gap: 4px;
	margin-bottom: 4px;
}

.mcpcomal-chat-nav-item {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 6px;
	background: transparent;
	border: none;
	border-radius: 6px;
	color: var(--mcpcomal-chat-sidebar-text-secondary);
	cursor: pointer;
	font-size: 13px;
	transition: background 0.15s, color 0.15s;
}

.mcpcomal-chat-nav-item:hover {
	background: var(--mcpcomal-chat-sidebar-hover, rgba(255, 255, 255, 0.08));
}

.mcpcomal-chat-nav-item.active {
	color: var(--mcpcomal-chat-sidebar-text);
	background: var(--mcpcomal-chat-sidebar-hover, rgba(255, 255, 255, 0.08));
}

/* Search box */

.mcpcomal-chat-search-box {
	padding: 0 12px 8px;
}

.mcpcomal-chat-search-box.hidden {
	display: none;
}

.mcpcomal-chat-search-input {
	width: 100%;
	padding: 8px 12px;
	background: var(--mcpcomal-chat-sidebar-input-bg, rgba(255, 255, 255, 0.1));
	border: 1px solid var(--mcpcomal-chat-sidebar-input-border, rgba(255, 255, 255, 0.15));
	border-radius: 6px;
	color: var(--mcpcomal-chat-sidebar-text);
	font-size: 13px;
	outline: none;
}

.mcpcomal-chat-search-input::placeholder {
	color: var(--mcpcomal-chat-sidebar-text-secondary);
}

.mcpcomal-chat-search-input:focus {
	border-color: var(--mcpcomal-chat-accent);
}

/* Sidebar label */

.mcpcomal-chat-sidebar-label {
	padding: 8px 16px 4px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--mcpcomal-chat-sidebar-text-secondary);
}

/* Conversation List */

.mcpcomal-chat-list {
	flex: 1;
	overflow-y: auto;
	padding: 4px 8px;
}

.mcpcomal-chat-list::-webkit-scrollbar {
	width: 6px;
}

.mcpcomal-chat-list::-webkit-scrollbar-track {
	background: transparent;
}

.mcpcomal-chat-list::-webkit-scrollbar-thumb {
	background: var(--mcpcomal-chat-sidebar-input-border, rgba(255, 255, 255, 0.2));
	border-radius: 3px;
}

.mcpcomal-chat-item {
	display: flex;
	align-items: center;
	padding: 8px 10px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s;
}

.mcpcomal-chat-item:hover {
	background: var(--mcpcomal-chat-sidebar-hover, rgba(255, 255, 255, 0.08));
}

.mcpcomal-chat-item.active {
	background: var(--mcpcomal-chat-sidebar-hover, rgba(255, 255, 255, 0.08));
	color: var(--mcpcomal-chat-sidebar-text);
}

.mcpcomal-chat-item-title {
	flex: 1;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mcpcomal-chat-item-delete {
	opacity: 0;
	color: var(--mcpcomal-chat-sidebar-text-secondary);
	cursor: pointer;
	padding: 2px 4px;
	font-size: 12px;
	transition: opacity 0.15s, color 0.15s;
}

.mcpcomal-chat-item:hover .mcpcomal-chat-item-delete {
	opacity: 1;
}

.mcpcomal-chat-item-delete:hover {
	color: var(--mcpcomal-chat-notification, #d63638);
}

.mcpcomal-chat-empty-list {
	padding: 24px 16px;
	text-align: center;
	color: var(--mcpcomal-chat-sidebar-text-secondary);
	font-size: 13px;
}

/* Sidebar Footer */

.mcpcomal-chat-sidebar-footer {
	padding: 12px;
	border-top: 1px solid var(--mcpcomal-chat-sidebar-border, rgba(255, 255, 255, 0.1));
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	position: relative;
	transition: background 0.15s;
}

.mcpcomal-chat-sidebar-footer:hover {
	background: var(--mcpcomal-chat-sidebar-hover, rgba(255, 255, 255, 0.08));
}

img.mcpcomal-chat-user-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}

.mcpcomal-chat-user-avatar-letter {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--mcpcomal-chat-accent);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 600;
	flex-shrink: 0;
}

.mcpcomal-chat-user-name {
	flex: 1;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mcpcomal-chat-footer-chevron {
	font-size: 10px;
	color: var(--mcpcomal-chat-sidebar-text-secondary);
	transition: transform 0.2s;
}

.mcpcomal-chat-sidebar-footer.open .mcpcomal-chat-footer-chevron {
	transform: rotate(180deg);
}

/* Popup menu */

.mcpcomal-chat-popup-menu {
	display: none;
	position: absolute;
	bottom: 100%;
	left: 8px;
	right: 8px;
	background: var(--mcpcomal-chat-bg-sidebar);
	border: 1px solid var(--mcpcomal-chat-sidebar-border, rgba(255, 255, 255, 0.1));
	border-radius: 8px;
	padding: 6px;
	margin-bottom: 4px;
	z-index: 10;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mcpcomal-chat-sidebar-footer.open .mcpcomal-chat-popup-menu {
	display: block;
}

.mcpcomal-chat-popup-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 6px;
	color: var(--mcpcomal-chat-sidebar-text);
	text-decoration: none;
	font-size: 13px;
	transition: background 0.15s;
}

.mcpcomal-chat-popup-item:hover {
	background: var(--mcpcomal-chat-sidebar-hover, rgba(255, 255, 255, 0.08));
	color: var(--mcpcomal-chat-sidebar-text);
}

.mcpcomal-chat-popup-sep {
	height: 1px;
	background: var(--mcpcomal-chat-sidebar-border, rgba(255, 255, 255, 0.1));
	margin: 4px 0;
}

/* ─── Main Area ───────────────────────────────────────────────── */

.mcpcomal-chat-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

/* ─── Welcome Screen ──────────────────────────────────────────── */

.mcpcomal-chat-welcome {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.mcpcomal-chat-welcome.hidden {
	display: none;
}

.mcpcomal-chat-welcome-center {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
}

.mcpcomal-chat-welcome-card {
	text-align: center;
	width: 100%;
	max-width: 520px;
	background: var(--mcpcomal-chat-msg-ai-bg);
	border: 1px solid var(--mcpcomal-chat-border);
	border-radius: 16px;
	padding: 40px 32px 32px;
}

.mcpcomal-chat-welcome-icon {
	font-size: 32px;
	width: 32px;
	height: 32px;
	color: var(--mcpcomal-chat-accent);
	margin-bottom: 16px;
}

.mcpcomal-chat-welcome-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0 0 8px;
	color: var(--mcpcomal-chat-text);
}

.mcpcomal-chat-welcome-subtitle {
	font-size: 14px;
	color: var(--mcpcomal-chat-text-secondary);
	margin: 0 0 28px;
}

.mcpcomal-chat-suggestions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.mcpcomal-chat-suggestion {
	padding: 12px 16px;
	background: transparent;
	border: 1px solid var(--mcpcomal-chat-border);
	border-radius: 10px;
	color: var(--mcpcomal-chat-text);
	font-size: 13px;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.mcpcomal-chat-suggestion:hover {
	background: var(--mcpcomal-chat-hover);
	border-color: var(--mcpcomal-chat-accent);
}

.mcpcomal-chat-welcome-bottom {
	padding: 12px 24px 20px;
}

.mcpcomal-chat-welcome-bottom .mcpcomal-chat-input-wrap {
	max-width: 800px;
	margin: 0 auto;
}

.mcpcomal-chat-welcome-bottom-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 800px;
	margin: 8px auto 0;
	padding: 0 4px;
}

.mcpcomal-chat-welcome-hint {
	font-size: 12px;
	color: var(--mcpcomal-chat-text-secondary);
}

/* ─── Chat View ───────────────────────────────────────────────── */

.mcpcomal-chat-view {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.mcpcomal-chat-view.hidden {
	display: none;
}

.mcpcomal-chat-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 20px;
	min-height: 48px;
}

.mcpcomal-chat-topbar-left {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mcpcomal-chat-toggle-sidebar {
	display: none;
	background: transparent;
	border: none;
	color: var(--mcpcomal-chat-text);
	cursor: pointer;
	padding: 4px;
	font-size: 18px;
}

.mcpcomal-chat-usage {
	font-size: 12px;
	color: var(--mcpcomal-chat-text-secondary);
}

/* ─── Model Picker ────────────────────────────────────────────── */

.mcpcomal-model-picker {
	position: relative;
}

.mcpcomal-model-picker-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px;
	background: transparent;
	border: none;
	border-radius: 8px;
	color: var(--mcpcomal-chat-text-secondary);
	cursor: pointer;
	font-size: 13px;
	transition: background 0.15s, color 0.15s;
}

.mcpcomal-model-picker-btn:hover {
	background: var(--mcpcomal-chat-hover);
	color: var(--mcpcomal-chat-text);
}

.mcpcomal-model-picker-label {
	font-weight: 400;
}

.mcpcomal-model-picker-chevron {
	font-size: 11px;
	width: 11px;
	height: 11px;
	transition: transform 0.2s;
}

.mcpcomal-model-picker.open .mcpcomal-model-picker-chevron {
	transform: rotate(180deg);
}

.mcpcomal-model-picker-dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 240px;
	background: var(--mcpcomal-chat-input-bg);
	border: 1px solid var(--mcpcomal-chat-border);
	border-radius: 12px;
	padding: 8px;
	z-index: 100;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	max-height: 380px;
	overflow-y: auto;
}

.mcpcomal-model-picker.open .mcpcomal-model-picker-dropdown {
	display: block;
}

.mcpcomal-model-picker-group {
	padding: 10px 10px 4px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--mcpcomal-chat-text-secondary);
}

.mcpcomal-model-picker-no-key {
	padding: 4px 10px 8px;
	font-size: 12px;
	color: var(--mcpcomal-chat-text-secondary);
	font-style: italic;
}

.mcpcomal-model-picker-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	color: var(--mcpcomal-chat-text);
	transition: background 0.15s;
}

.mcpcomal-model-picker-item:hover {
	background: var(--mcpcomal-chat-hover);
}

.mcpcomal-model-picker-item .mcpcomal-check {
	width: 16px;
	text-align: center;
	font-size: 13px;
	color: var(--mcpcomal-chat-accent);
	visibility: hidden;
}

.mcpcomal-model-picker-item.active .mcpcomal-check {
	visibility: visible;
}

.mcpcomal-model-picker-sep {
	height: 1px;
	background: var(--mcpcomal-chat-border);
	margin: 6px 0;
}

/* Welcome picker — position above instead of below */
.mcpcomal-chat-welcome-bottom-meta .mcpcomal-model-picker-dropdown {
	bottom: calc(100% + 6px);
	top: auto;
}

/* ─── Messages ────────────────────────────────────────────────── */

.mcpcomal-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.mcpcomal-chat-messages::-webkit-scrollbar {
	width: 6px;
}

.mcpcomal-chat-messages::-webkit-scrollbar-track {
	background: transparent;
}

.mcpcomal-chat-messages::-webkit-scrollbar-thumb {
	background: var(--mcpcomal-chat-border);
	border-radius: 3px;
}

.mcpcomal-msg-user {
	align-self: flex-end;
	max-width: 85%;
	padding: 12px 16px;
	background: var(--mcpcomal-chat-msg-user-bg);
	color: var(--mcpcomal-chat-msg-user-text);
	border-radius: 12px;
	border-bottom-right-radius: 4px;
	line-height: 1.55;
	word-wrap: break-word;
	animation: mcpcomal-fade-in 0.2s ease-out;
}

.mcpcomal-msg-assistant {
	align-self: flex-start;
	max-width: 100%;
	line-height: 1.7;
	color: var(--mcpcomal-chat-msg-ai-text);
	animation: mcpcomal-fade-in 0.2s ease-out;
}

@keyframes mcpcomal-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Markdown inside assistant messages */

.mcpcomal-msg-assistant h1,
.mcpcomal-msg-assistant h2,
.mcpcomal-msg-assistant h3,
.mcpcomal-msg-assistant h4 {
	margin: 16px 0 8px;
	line-height: 1.3;
}

.mcpcomal-msg-assistant h1:first-child,
.mcpcomal-msg-assistant h2:first-child,
.mcpcomal-msg-assistant h3:first-child {
	margin-top: 0;
}

.mcpcomal-msg-assistant p {
	margin: 0 0 10px;
}

.mcpcomal-msg-assistant p:last-child {
	margin-bottom: 0;
}

.mcpcomal-msg-assistant ul,
.mcpcomal-msg-assistant ol {
	margin: 6px 0 10px;
	padding-left: 22px;
}

.mcpcomal-msg-assistant li {
	margin-bottom: 4px;
}

.mcpcomal-msg-assistant code {
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 13px;
	font-family: Consolas, Monaco, "Andale Mono", monospace;
	background: var(--mcpcomal-chat-hover);
	color: var(--mcpcomal-chat-accent);
}

.mcpcomal-msg-assistant pre {
	margin: 10px 0;
	padding: 14px;
	border-radius: 8px;
	overflow-x: auto;
	background: #1a1816 !important;
	color: #e2ddd8;
}

.mcpcomal-msg-assistant pre code {
	padding: 0;
	background: transparent;
	color: inherit;
	font-size: 13px;
}

.mcpcomal-msg-assistant a {
	color: var(--mcpcomal-chat-accent);
	text-decoration: underline;
}

.mcpcomal-msg-assistant table {
	border-collapse: collapse;
	margin: 10px 0;
	width: 100%;
}

.mcpcomal-msg-assistant th,
.mcpcomal-msg-assistant td {
	border: 1px solid var(--mcpcomal-chat-border);
	padding: 8px 12px;
	text-align: left;
	font-size: 13px;
}

.mcpcomal-msg-assistant th {
	font-weight: 600;
}

.mcpcomal-msg-assistant blockquote {
	margin: 10px 0;
	padding: 10px 14px;
	border-left: 3px solid var(--mcpcomal-chat-accent);
	background: var(--mcpcomal-chat-hover);
}

/* ─── Tool Calls (accordion) ─────────────────────────────────── */

.mcpcomal-tool-call {
	border: 1px solid var(--mcpcomal-chat-border);
	border-radius: 8px;
	margin: 8px 0;
	overflow: hidden;
	font-size: 13px;
}

.mcpcomal-tool-call-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	cursor: pointer;
	user-select: none;
	transition: background 0.15s;
}

.mcpcomal-tool-call-header:hover {
	background: var(--mcpcomal-chat-hover);
}

.mcpcomal-tool-call-status {
	width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
}

.mcpcomal-tool-call-status.success {
	color: #22c55e;
}

.mcpcomal-tool-call-status.error {
	color: #ef4444;
}

.mcpcomal-tool-call-status.confirmation {
	color: #dba617;
}

.mcpcomal-tool-call-name {
	font-family: Consolas, Monaco, monospace;
	font-weight: 500;
	color: var(--mcpcomal-chat-text);
}

.mcpcomal-tool-call-chevron {
	margin-left: auto;
	font-size: 10px;
	color: var(--mcpcomal-chat-text-secondary);
	transition: transform 0.2s;
}

.mcpcomal-tool-call.open .mcpcomal-tool-call-chevron {
	transform: rotate(90deg);
}

.mcpcomal-tool-call-body {
	display: none;
	padding: 12px;
	border-top: 1px solid var(--mcpcomal-chat-border);
}

.mcpcomal-tool-call.open .mcpcomal-tool-call-body {
	display: block;
}

.mcpcomal-tool-call-body pre {
	margin: 6px 0 0;
	padding: 10px;
	border-radius: 6px;
	font-family: Consolas, Monaco, monospace;
	font-size: 12px;
	line-height: 1.4;
	overflow-x: auto;
	white-space: pre-wrap;
	word-break: break-word;
	background: #1a1816;
	color: #e2ddd8;
	max-height: 300px;
	overflow-y: auto;
}

/* ─── Error Message ───────────────────────────────────────────── */

.mcpcomal-msg-error {
	align-self: flex-start;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: #ef4444;
	font-size: 14px;
	animation: mcpcomal-fade-in 0.2s ease-out;
}

/* ─── Typing Indicator ────────────────────────────────────────── */

.mcpcomal-typing {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 4px 0;
}

.mcpcomal-typing-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--mcpcomal-chat-text-secondary);
	animation: mcpcomal-typing-bounce 1.4s infinite both;
}

.mcpcomal-typing-dot:nth-child(2) {
	animation-delay: 0.2s;
}

.mcpcomal-typing-dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes mcpcomal-typing-bounce {
	0%, 80%, 100% { opacity: 0.3; transform: scale(0.6); }
	40% { opacity: 1; transform: scale(1); }
}

/* ─── Input Area (Chat View) ──────────────────────────────────── */

.mcpcomal-chat-input {
	padding: 12px 24px 20px;
}

.mcpcomal-chat-input-wrap {
	display: flex;
	align-items: flex-end;
	border: 1px solid var(--mcpcomal-chat-border);
	border-radius: 24px;
	padding: 6px;
	max-width: 800px;
	margin: 0 auto;
	background: var(--mcpcomal-chat-input-bg);
}

.mcpcomal-chat-input-wrap textarea {
	flex: 1;
	padding: 10px 14px;
	border: none;
	background: transparent;
	color: var(--mcpcomal-chat-input-text);
	font-size: 15px;
	font-family: inherit;
	line-height: 1.5;
	resize: none;
	outline: none;
	min-height: 44px;
	max-height: 200px;
}

.mcpcomal-chat-input-wrap textarea::placeholder {
	color: var(--mcpcomal-chat-text-secondary);
}

.mcpcomal-chat-send-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--mcpcomal-chat-text);
	color: var(--mcpcomal-chat-bg-main);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
	transition: opacity 0.2s;
}

.mcpcomal-chat-send-btn:hover {
	opacity: 0.85;
}

.mcpcomal-chat-send-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ─── No API Key State ────────────────────────────────────────── */

.mcpcomal-chat-no-key {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	text-align: center;
}

.mcpcomal-chat-no-key .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: var(--mcpcomal-chat-notification, #d63638);
	margin-bottom: 16px;
}

.mcpcomal-chat-no-key p {
	font-size: 15px;
	color: var(--mcpcomal-chat-text-secondary);
	margin: 0 0 16px;
}

.mcpcomal-chat-no-key a {
	display: inline-block;
	padding: 10px 20px;
	background: var(--mcpcomal-chat-accent);
	color: #fff;
	text-decoration: none;
	border-radius: 8px;
	font-weight: 500;
}

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
	.mcpcomal-chat-sidebar {
		position: fixed;
		left: -260px;
		top: 0;
		bottom: 0;
		z-index: 100000;
		transition: left 0.3s ease;
	}

	.mcpcomal-chat-sidebar.open {
		left: 0;
	}

	.mcpcomal-chat-sidebar-overlay {
		display: none;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: 99999;
	}

	.mcpcomal-chat-sidebar.open ~ .mcpcomal-chat-sidebar-overlay {
		display: block;
	}

	.mcpcomal-chat-toggle-sidebar {
		display: block;
	}

	.mcpcomal-msg-user {
		max-width: 95%;
	}

	.mcpcomal-chat-welcome-title {
		font-size: 1.25rem;
	}

	.mcpcomal-chat-suggestions {
		grid-template-columns: 1fr;
	}

	.mcpcomal-chat-welcome-card {
		padding: 28px 20px 24px;
	}

	.mcpcomal-chat-welcome-hint {
		display: none;
	}
}

/* ─── Loading State ───────────────────────────────────────────── */

#mcpcomal-chat-app[data-loading="true"] {
	align-items: center;
	justify-content: center;
}

#mcpcomal-chat-app[data-loading="true"]::after {
	content: "";
	width: 40px;
	height: 40px;
	border: 3px solid var(--mcpcomal-chat-border);
	border-top-color: var(--mcpcomal-chat-accent);
	border-radius: 50%;
	animation: mcpcomal-spin 0.8s linear infinite;
}

@keyframes mcpcomal-spin {
	to { transform: rotate(360deg); }
}

/* ─── Rename Input ────────────────────────────────────────────── */

.mcpcomal-chat-rename-input {
	width: 100%;
	padding: 4px 8px;
	background: var(--mcpcomal-chat-sidebar-input-bg, rgba(255, 255, 255, 0.15));
	border: 1px solid var(--mcpcomal-chat-accent);
	border-radius: 4px;
	color: var(--mcpcomal-chat-sidebar-text);
	font-size: 13px;
	outline: none;
}
