/* Mini Mili — Domic Realty Chat widget. All classes prefixed mm-. */

.mm-widget {
	--mm-bg: #111111;
	--mm-bg-soft: #141414;
	--mm-gold: #c9a24b;
	--mm-ivory: #f5efe4;
	--mm-muted: #b8b0a0;
	--mm-border: #2c2c2c;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: 'Jost', 'Segoe UI', system-ui, -apple-system, sans-serif;
	color: var(--mm-ivory);
}

/* The hidden attribute must always win: the panel and teaser are shown and
   hidden by toggling [hidden] from JS, and an author display rule (e.g.
   .mm-panel's display:flex) would otherwise override the UA's
   [hidden] { display: none } and leave the panel stuck open. */
.mm-panel[hidden],
.mm-teaser[hidden] {
	display: none !important;
}

/* ---------- Teaser card ---------- */

.mm-teaser {
	position: absolute;
	right: 0;
	bottom: 64px;
	width: 240px;
	max-width: calc(100vw - 40px);
	background: var(--mm-bg-soft);
	border: 1px solid var(--mm-gold);
	border-radius: 12px;
	padding: 12px 34px 12px 14px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	font-size: 15px;
	line-height: 1.4;
}

.mm-teaser-close {
	position: absolute;
	top: 4px;
	right: 8px;
	background: none;
	border: 0;
	color: var(--mm-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
	min-width: 32px;
	min-height: 32px;
}

.mm-teaser-close:hover {
	color: var(--mm-ivory);
}

/* ---------- Bubble ---------- */

.mm-bubble {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	background: var(--mm-bg);
	color: var(--mm-gold);
	border: 1px solid var(--mm-gold);
	border-radius: 999px;
	padding: 13px 20px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	min-height: 48px;
}

.mm-bubble:hover,
.mm-bubble:focus {
	background: #1c1a14;
	outline: none;
}

.mm-bubble-icon {
	font-size: 18px;
}

/* ---------- Panel ---------- */

.mm-panel {
	position: absolute;
	right: 0;
	bottom: 64px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
	display: flex;
	flex-direction: column;
	background: var(--mm-bg);
	border: 1px solid var(--mm-border);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.mm-panel-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	background: var(--mm-bg-soft);
	border-bottom: 1px solid var(--mm-gold);
	padding: 14px 16px;
}

.mm-panel-name {
	display: block;
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 21px;
	font-weight: 600;
	color: var(--mm-ivory);
	line-height: 1.2;
}

.mm-panel-status {
	display: block;
	font-size: 12.5px;
	color: var(--mm-muted);
	margin-top: 2px;
}

.mm-close {
	background: none;
	border: 0;
	color: var(--mm-muted);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
	min-width: 40px;
	min-height: 40px;
}

.mm-close:hover {
	color: var(--mm-ivory);
}

/* ---------- Messages ---------- */

.mm-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	-webkit-overflow-scrolling: touch;
}

.mm-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 15.5px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.mm-msg a {
	color: var(--mm-gold);
	text-decoration: underline;
}

.mm-msg-assistant {
	align-self: flex-start;
	background: #1e1e1e;
	border: 1px solid var(--mm-border);
	border-bottom-left-radius: 4px;
	color: var(--mm-ivory);
}

.mm-msg-user {
	align-self: flex-end;
	background: var(--mm-gold);
	border-bottom-right-radius: 4px;
	color: #141414;
}

.mm-msg-system {
	align-self: center;
	background: transparent;
	color: var(--mm-muted);
	font-size: 13.5px;
	text-align: center;
}

/* Choice card (valuation options) */

.mm-choice {
	align-self: stretch;
	background: #1e1e1e;
	border: 1px solid var(--mm-gold);
	border-radius: 14px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mm-choice-title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 19px;
	color: var(--mm-ivory);
	line-height: 1.25;
}

.mm-choice-btn {
	display: block;
	width: 100%;
	text-align: left;
	background: var(--mm-bg);
	color: var(--mm-ivory);
	border: 1px solid var(--mm-gold);
	border-radius: 10px;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 15.5px;
	cursor: pointer;
	min-height: 48px;
}

.mm-choice-btn strong {
	display: block;
	color: var(--mm-gold);
	font-size: 16px;
}

.mm-choice-btn:hover,
.mm-choice-btn:focus {
	background: #23200f;
	outline: none;
}

/* Typing indicator */

.mm-typing {
	display: inline-flex;
	gap: 5px;
	align-items: center;
	padding: 12px 14px;
}

.mm-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mm-muted);
	animation: mm-blink 1.2s infinite;
}

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

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

@keyframes mm-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

/* ---------- Chips ---------- */

.mm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 14px 4px;
	border-top: 1px solid var(--mm-border);
	background: var(--mm-bg-soft);
}

.mm-chip {
	background: transparent;
	border: 1px solid var(--mm-gold);
	color: var(--mm-gold);
	border-radius: 999px;
	padding: 9px 13px;
	font-family: inherit;
	font-size: 14px;
	cursor: pointer;
	min-height: 40px;
}

.mm-chip:hover,
.mm-chip:focus {
	background: rgba(201, 162, 75, 0.14);
	outline: none;
}

/* ---------- Input ---------- */

.mm-input-row {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	background: var(--mm-bg-soft);
}

.mm-input {
	flex: 1 1 auto;
	min-width: 0;
	background: #1e1e1e;
	border: 1px solid var(--mm-border);
	border-radius: 10px;
	color: var(--mm-ivory);
	/* 16px minimum prevents iOS Safari focus zoom. */
	font-size: 16px;
	font-family: inherit;
	padding: 11px 12px;
	min-height: 48px;
}

.mm-input:focus {
	border-color: var(--mm-gold);
	outline: none;
}

.mm-send {
	background: var(--mm-gold);
	color: #141414;
	border: 0;
	border-radius: 10px;
	padding: 0 18px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	min-height: 48px;
	min-width: 64px;
}

.mm-send:disabled {
	opacity: 0.55;
	cursor: default;
}

/* ---------- Footer ---------- */

.mm-panel-footer {
	text-align: center;
	font-size: 12px;
	color: var(--mm-muted);
	padding: 8px 12px 10px;
	background: var(--mm-bg-soft);
	border-top: 1px solid var(--mm-border);
	letter-spacing: 0.04em;
}

/* ---------- Mobile: near-full-screen sheet ---------- */

@media (max-width: 640px) {
	.mm-widget {
		right: 12px;
		bottom: 12px;
	}

	.mm-panel {
		position: fixed;
		right: 8px;
		left: 8px;
		bottom: 8px;
		width: auto;
		max-width: none;
		height: calc(100vh - 88px);
		height: calc(100dvh - 88px);
		max-height: none;
	}

	.mm-teaser {
		bottom: 60px;
	}

	.mm-bubble {
		padding: 14px 18px;
	}
}
