/* Mira floating chatbot — premium aesthetic clinic look */
#mira-root {
	--mira-accent: #0a7d5a;
	--mira-accent-2: #0e9c72;
	--mira-bg: #ffffff;
	--mira-soft: #f3faf7;
	--mira-ink: #1f2a27;
	--mira-muted: #6b7c77;
	--mira-line: #e6efeb;
	--mira-radius: 20px;
	--mira-shadow: 0 18px 50px -12px rgba(16,60,46,0.32);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#mira-root *, #mira-root *::before, #mira-root *::after { box-sizing: border-box; }

/* Launcher */
.mira-launcher {
	position: fixed; right: 24px; bottom: 24px; z-index: 99998;
	display: flex; align-items: center; gap: 10px;
	background: linear-gradient(135deg, var(--mira-accent-2), var(--mira-accent));
	color: #fff; border: 0; cursor: pointer;
	padding: 10px 18px 10px 10px; border-radius: 999px;
	box-shadow: var(--mira-shadow);
	transition: transform .25s cubic-bezier(.34,1.4,.64,1), box-shadow .25s;
}
.mira-launcher:hover { transform: translateY(-2px); }
.mira-launcher img, .mira-launcher .mira-ava-svg { width: 38px; height: 38px; border-radius: 50%; background: #fff; flex: none; }
.mira-ava-svg { background-image: url('../img/mira-avatar.svg'); background-size: cover; background-position: center; }
.mira-launcher-label { font-weight: 600; font-size: 14px; white-space: nowrap; }
.mira-launcher .mira-dot { width: 8px; height: 8px; border-radius: 50%; background: #7CFFB2; box-shadow: 0 0 0 3px rgba(124,255,178,.35); }

/* Panel */
.mira-panel-chat {
	position: fixed; right: 24px; bottom: 24px; z-index: 99999;
	width: 380px; max-width: calc(100vw - 32px); height: 600px; max-height: calc(100vh - 48px);
	background: var(--mira-bg); border-radius: var(--mira-radius);
	box-shadow: var(--mira-shadow); display: flex; flex-direction: column; overflow: hidden;
	opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
	transition: opacity .28s ease, transform .28s cubic-bezier(.34,1.2,.64,1);
}
.mira-panel-chat.is-open { opacity: 1; transform: none; pointer-events: auto; }

/* Header */
.mira-head {
	display: flex; align-items: center; gap: 12px; padding: 16px 18px;
	background: linear-gradient(135deg, var(--mira-accent-2), var(--mira-accent)); color: #fff;
}
.mira-head img, .mira-head .mira-ava-svg { width: 44px; height: 44px; border-radius: 50%; background: #fff; flex: none; }
.mira-head h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.2; }
.mira-head .mira-status { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.mira-head .mira-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7CFFB2; }
.mira-close { margin-left: auto; background: rgba(255,255,255,.18); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.mira-close:hover { background: rgba(255,255,255,.3); }

/* Body */
.mira-body { flex: 1; overflow-y: auto; padding: 18px; background: var(--mira-soft); scroll-behavior: smooth; }
.mira-body::-webkit-scrollbar { width: 8px; }
.mira-body::-webkit-scrollbar-thumb { background: #d3e4dd; border-radius: 8px; }

/* Messages */
.mira-msg { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-end; }
.mira-msg .mira-ava { width: 30px; height: 30px; border-radius: 50%; flex: none; background: #fff; }
.mira-bubble {
	max-width: 78%; padding: 12px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55;
	background: #fff; color: var(--mira-ink); box-shadow: 0 4px 14px rgba(16,60,46,.06); border: 1px solid var(--mira-line);
}
.mira-bubble p { margin: 0 0 8px; }
.mira-bubble p:last-child { margin: 0; }
.mira-bubble strong { color: var(--mira-accent); }
.mira-bubble ul { margin: 6px 0 0; padding-left: 18px; }
.mira-bubble li { margin-bottom: 4px; }
.mira-msg.is-user { flex-direction: row-reverse; }
.mira-msg.is-user .mira-bubble { background: linear-gradient(135deg, var(--mira-accent-2), var(--mira-accent)); color: #fff; border: 0; }

/* Section title inside bubble */
.mira-sec { margin-top: 10px; }
.mira-sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--mira-accent); margin: 0 0 4px; }

/* Chips / concern buttons */
.mira-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.mira-chip {
	display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
	background: #fff; border: 1px solid var(--mira-line); color: var(--mira-ink);
	padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
	transition: border-color .2s, color .2s, transform .15s;
}
.mira-chip:hover { border-color: var(--mira-accent); color: var(--mira-accent); transform: translateY(-1px); }
.mira-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* Link/resource buttons */
.mira-links { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.mira-link {
	display: flex; align-items: center; gap: 8px; text-decoration: none;
	padding: 9px 12px; border-radius: 12px; font-size: 13px; font-weight: 600;
	background: var(--mira-soft); color: var(--mira-accent); border: 1px solid var(--mira-line);
}
.mira-link:hover { background: #e7f4ef; }
.mira-link .mira-ico { width: 16px; height: 16px; flex: none; }

/* CTA */
.mira-cta {
	display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
	margin-top: 8px; padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
	background: linear-gradient(135deg, var(--mira-accent-2), var(--mira-accent)); color: #fff;
	box-shadow: 0 8px 20px -8px rgba(10,125,90,.6);
}
.mira-cta:hover { filter: brightness(1.05); }

/* Typing */
.mira-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.mira-typing span { width: 7px; height: 7px; border-radius: 50%; background: #c2d6cd; animation: mira-bounce 1s infinite; }
.mira-typing span:nth-child(2) { animation-delay: .15s; }
.mira-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mira-bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Footer input */
.mira-foot { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--mira-line); background: #fff; }
.mira-foot input {
	flex: 1; border: 1px solid var(--mira-line); border-radius: 999px; padding: 11px 16px; font-size: 14px; outline: none; color: var(--mira-ink);
}
.mira-foot input:focus { border-color: var(--mira-accent); }
.mira-send {
	border: 0; cursor: pointer; width: 44px; height: 44px; border-radius: 50%; flex: none;
	background: linear-gradient(135deg, var(--mira-accent-2), var(--mira-accent)); color: #fff;
	display: flex; align-items: center; justify-content: center;
}
.mira-send:hover { filter: brightness(1.05); }
.mira-send svg { width: 18px; height: 18px; }

/* Mobile */
@media (max-width: 480px) {
	.mira-panel-chat { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
	.mira-launcher { right: 16px; bottom: 16px; }
	.mira-launcher-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.mira-launcher, .mira-panel-chat, .mira-chip, .mira-typing span { transition: none !important; animation: none !important; }
}
