/*
 * Mashin Irani — Gaftino chat widget (visitor). Floating panel anchored to the #gaftino button.
 * Tokens from mi.css.
 */
.mi-chatw {
	position: fixed;
	inset-inline-end: var(--space-6, 24px);
	bottom: calc(var(--space-6, 24px) + 68px);
	z-index: 2147483000;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 140px);
	background: var(--bg-elevated, #fff);
	border: 1px solid var(--border, #d9cbc2);
	border-radius: var(--radius-lg, 12px);
	box-shadow: var(--shadow-e5, 0 24px 48px rgba(16, 33, 52, .24));
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: inherit;
	animation: mi-chatw-in .18s ease;
}
@keyframes mi-chatw-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.mi-chatw[hidden] { display: none; }
.mi-chatw__head { background: linear-gradient(135deg, var(--navy-900, #102134), var(--navy-800, #112250)); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.mi-chatw__title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.mi-chatw__title small { color: var(--gold-300, #e0c58f); font-weight: 500; font-size: .72rem; margin-inline-start: 2px; }
.mi-chatw__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success, #2e7d5b); box-shadow: 0 0 0 3px rgba(46, 125, 91, .25); flex: none; }
.mi-chatw__close { background: transparent; border: 0; color: #fff; cursor: pointer; padding: 4px; display: flex; }
.mi-chatw__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mi-chatw__body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-sunken, #ece4da); }
.mi-chatw__intro { background: var(--bg-elevated, #fff); border: 1px solid var(--border, #d9cbc2); border-radius: 10px; padding: 10px 12px; font-size: .82rem; line-height: 1.8; color: var(--text-secondary, #404751); }
.mi-msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: .85rem; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.mi-msg--visitor { align-self: flex-end; background: var(--navy-900, #102134); color: #fff; }
.mi-msg--admin { align-self: flex-start; background: var(--bg-elevated, #fff); border: 1px solid var(--border, #d9cbc2); color: var(--text-secondary, #404751); }
.mi-msg__t { display: block; font-size: .62rem; opacity: .6; margin-top: 2px; }
.mi-chatw__foot { border-top: 1px solid var(--border, #d9cbc2); padding: 10px; background: var(--bg-elevated, #fff); display: flex; flex-direction: column; gap: 8px; }
.mi-chatw__name { border: 1px solid var(--border-strong, #c0b2a6); border-radius: 8px; padding: 8px 10px; font-size: .8rem; font-family: inherit; color: var(--navy-900, #102134); }
.mi-chatw__name:focus { outline: none; border-color: var(--gold-500, #896f3d); }
.mi-chatw__inputrow { display: flex; gap: 8px; align-items: flex-end; }
.mi-chatw__input { flex: 1; resize: none; max-height: 100px; border: 1px solid var(--border-strong, #c0b2a6); border-radius: 10px; padding: 9px 12px; font-size: .85rem; font-family: inherit; line-height: 1.7; color: var(--navy-900, #102134); }
.mi-chatw__input:focus { outline: none; border-color: var(--gold-500, #896f3d); }
.mi-chatw__send { flex: none; width: 42px; height: 42px; border-radius: 10px; background: var(--action-buy, #112250); border: 0; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mi-chatw__send svg { width: 20px; height: 20px; }
.mi-chatw__send:disabled { opacity: .5; cursor: default; }
/* Unread badge on the floating #gaftino button (button is position:fixed, so ::after anchors to it). */
.gaftino.mi-has-unread::after { content: attr(data-unread); position: absolute; top: -5px; inset-inline-start: -5px; background: var(--clay-error, #b4402e); color: #fff; font-size: .62rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
@media (max-width: 520px) {
	.mi-chatw { inset-inline: 12px; width: auto; max-width: none; bottom: 150px; height: 66vh; }
}
