/* ==========================================================================
   CBMC Advisor Page V11 — embedded chat interface + hero styling
   ========================================================================== */

.cbmc-v11-chat {
	background:#FFFFFF;
	border:1px solid #E5E1D8;
	box-shadow:0 20px 60px rgba(11,46,91,0.08);
	overflow:hidden;
	display:flex;
	flex-direction:column;
	min-height:640px;
	max-height:800px;
	border-radius:2px;
}

/* Header */
.cbmc-v11-chat-head {
	display:flex;
	justify-content:space-between;
	align-items:flex-start;
	gap:20px;
	background:#0B2E5B;
	color:#FAF7F1;
	padding:22px 28px;
	position:relative;
	flex-shrink:0;
}
.cbmc-v11-chat-head::after {
	content:""; position:absolute; left:0; right:0; bottom:0; height:1px;
	background:linear-gradient(90deg, transparent, #4FB0C6, transparent);
}
.cbmc-v11-chat-title { flex:1; }
.cbmc-v11-chat-sub {
	display:block;
	font-family:'Inter',sans-serif;
	font-size:11px;
	letter-spacing:0.15em;
	text-transform:uppercase;
	color:#4FB0C6;
	font-weight:600;
	margin-bottom:4px;
}
.cbmc-v11-chat-title h3 {
	font-family:'Fraunces',serif;
	font-size:20px;
	font-weight:600;
	letter-spacing:-0.02em;
	line-height:1.2;
	margin:0;
	color:#FAF7F1;
}
.cbmc-v11-clear {
	background:transparent;
	color:#FAF7F1;
	border:1px solid rgba(250,247,241,0.3);
	padding:8px 14px;
	font-family:'Inter',sans-serif;
	font-size:12px;
	font-weight:500;
	letter-spacing:0.02em;
	cursor:pointer;
	display:inline-flex;
	align-items:center;
	gap:6px;
	transition:border-color .2s, background .2s;
	border-radius:2px;
	flex-shrink:0;
	line-height:1;
}
.cbmc-v11-clear:hover { border-color:#4FB0C6; background:rgba(79,176,198,0.08); }
.cbmc-v11-clear svg { width:14px; height:14px; }

/* Body / message list */
.cbmc-v11-chat-body {
	flex:1;
	overflow-y:auto;
	padding:28px 32px;
	display:flex;
	flex-direction:column;
	gap:16px;
	background:#FAF7F1;
}
.cbmc-v11-chat-body::-webkit-scrollbar { width:6px; }
.cbmc-v11-chat-body::-webkit-scrollbar-thumb { background:#E5E1D8; border-radius:2px; }

.cbmc-v11-msg {
	max-width:88%;
	padding:14px 18px;
	border-radius:2px;
	font-size:15px;
	line-height:1.6;
	animation:cbmc-v11-fade 0.25s ease-out;
}
@keyframes cbmc-v11-fade { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

.cbmc-v11-msg.bot {
	align-self:flex-start;
	background:#FFFFFF;
	border:1px solid #E5E1D8;
	color:#1A1A1A;
}
.cbmc-v11-msg.user {
	align-self:flex-end;
	background:#0B2E5B;
	color:#FAF7F1;
	border:1px solid #0B2E5B;
	max-width:70%;
}
.cbmc-v11-msg-meta {
	font-size:10px;
	text-transform:uppercase;
	letter-spacing:0.12em;
	color:#6B7280;
	font-weight:600;
	margin-bottom:6px;
}
.cbmc-v11-msg.user .cbmc-v11-msg-meta { color:rgba(250,247,241,0.6); }

/* Markdown rendering */
.cbmc-v11-body h2 { font-family:'Fraunces',serif; font-size:20px; font-weight:600; color:#0B2E5B; margin:16px 0 8px; letter-spacing:-0.015em; }
.cbmc-v11-body h3 { font-family:'Fraunces',serif; font-size:17px; font-weight:600; color:#0B2E5B; margin:12px 0 6px; }
.cbmc-v11-body p { margin:0 0 10px; }
.cbmc-v11-body ul, .cbmc-v11-body ol { margin:8px 0 12px; padding-left:22px; }
.cbmc-v11-body li { margin-bottom:5px; }
.cbmc-v11-body strong { color:#0B2E5B; font-weight:600; }
.cbmc-v11-body a { color:#4FB0C6; text-decoration:underline; text-underline-offset:2px; }
.cbmc-v11-body code { background:rgba(11,46,91,0.06); padding:1px 6px; border-radius:2px; font-family:'SF Mono',Menlo,Consolas,monospace; font-size:14px; color:#0B2E5B; }
.cbmc-v11-body table { width:100%; border-collapse:collapse; margin:12px 0; font-size:14px; }
.cbmc-v11-body th { background:#0B2E5B; color:#FAF7F1; padding:10px 12px; text-align:left; font-weight:600; font-family:'Inter',sans-serif; font-size:12px; text-transform:uppercase; letter-spacing:0.08em; }
.cbmc-v11-body td { padding:10px 12px; border-bottom:1px solid #E5E1D8; vertical-align:top; }

/* Warning capsule */
.cbmc-v11-warn {
	background:linear-gradient(90deg, rgba(184,137,74,0.10), rgba(184,137,74,0.05));
	border:1px solid rgba(184,137,74,0.3);
	padding:12px 14px;
	margin-bottom:12px;
	font-size:13px;
	line-height:1.5;
	color:#5A4419;
	border-radius:2px;
}
.cbmc-v11-warn strong { color:#5A4419; }

/* Typing indicator */
.cbmc-v11-typing {
	align-self:flex-start;
	background:#FFFFFF;
	border:1px solid #E5E1D8;
	padding:16px 20px;
	display:inline-flex;
	gap:5px;
	border-radius:2px;
}
.cbmc-v11-typing span {
	width:7px; height:7px; background:#4FB0C6; border-radius:50%;
	animation:cbmc-v11-blink 1.4s infinite ease-in-out;
}
.cbmc-v11-typing span:nth-child(2) { animation-delay:0.16s; }
.cbmc-v11-typing span:nth-child(3) { animation-delay:0.32s; }
@keyframes cbmc-v11-blink { 0%,80%,100% { opacity:0.3; transform:scale(0.9); } 40% { opacity:1; transform:scale(1); } }

/* CTA row */
.cbmc-v11-cta-row { display:flex; gap:8px; margin-top:14px; }
.cbmc-v11-cta-btn {
	flex:1;
	padding:10px 14px;
	border:1px solid #4FB0C6;
	background:#4FB0C6;
	color:#FFFFFF;
	text-decoration:none;
	text-align:center;
	font-size:13px;
	font-weight:600;
	letter-spacing:0.02em;
	border-radius:2px;
	transition:transform .15s;
	font-family:'Inter',sans-serif;
}
.cbmc-v11-cta-btn.ghost { background:transparent; color:#0B2E5B; border-color:#0B2E5B; }
.cbmc-v11-cta-btn:hover { transform:translateY(-1px); }

/* Input area */
.cbmc-v11-chat-input {
	padding:20px 28px 22px;
	background:#FFFFFF;
	border-top:1px solid #E5E1D8;
	flex-shrink:0;
}
.cbmc-v11-chip-row {
	display:flex;
	flex-wrap:wrap;
	gap:8px;
	margin-bottom:14px;
}
.cbmc-v11-chip {
	background:transparent;
	border:1px solid #E5E1D8;
	color:#0B2E5B;
	font-family:'Inter',sans-serif;
	font-size:12px;
	padding:7px 14px;
	border-radius:16px;
	cursor:pointer;
	transition:all .15s;
}
.cbmc-v11-chip:hover { border-color:#4FB0C6; background:rgba(79,176,198,0.06); }

.cbmc-v11-input-wrap {
	display:flex;
	gap:10px;
	align-items:flex-end;
}
.cbmc-v11-input-wrap textarea {
	flex:1;
	border:1px solid #E5E1D8;
	background:#FAF7F1;
	padding:14px 18px;
	font-family:'Inter',sans-serif;
	font-size:15px;
	color:#1A1A1A;
	border-radius:2px;
	resize:none;
	min-height:52px;
	max-height:160px;
	line-height:1.4;
	box-sizing:border-box;
}
.cbmc-v11-input-wrap textarea:focus { outline:none; border-color:#4FB0C6; }
.cbmc-v11-input-wrap button {
	background:#0B2E5B;
	color:#FFFFFF;
	border:none;
	border-radius:2px;
	padding:0;
	width:52px;
	height:52px;
	cursor:pointer;
	display:inline-flex;
	align-items:center;
	justify-content:center;
	flex-shrink:0;
	transition:background .2s;
}
.cbmc-v11-input-wrap button:hover { background:#0f3970; }
.cbmc-v11-input-wrap button:disabled { background:#6B7280; cursor:not-allowed; }
.cbmc-v11-input-wrap button svg { width:20px; height:20px; fill:#FAF7F1; }
.cbmc-v11-footnote {
	margin:12px 0 0;
	font-size:11px;
	letter-spacing:0.05em;
	color:#6B7280;
	text-align:center;
}

/* Mobile */
@media (max-width:900px) {
	.cbmc-v11-chat { min-height:520px; }
	.cbmc-v11-chat-head { padding:16px 20px; }
	.cbmc-v11-chat-body { padding:20px; }
	.cbmc-v11-chat-input { padding:16px 20px 18px; }
	.cbmc-v11-msg { max-width:94%; font-size:14px; padding:12px 15px; }
	.cbmc-v11-clear span, .cbmc-v11-clear { padding:6px 10px; font-size:11px; }
}

/* RTL (V3) */
body.cbmc-rtl .cbmc-v11-msg.bot { align-self:flex-end; }
body.cbmc-rtl .cbmc-v11-msg.user { align-self:flex-start; }
