/* Media Mine 360 Chat Widget — styles
   --mm360-ink and --mm360-accent are set inline by the plugin (Settings → MM360 Chat Widget).
   Everything below derives a matching palette around those two colors. */

#mm360-launcher,
#mm360-panel,
#mm360-panel * {
	box-sizing: border-box;
}

#mm360-launcher, #mm360-panel {
	--panel: color-mix(in srgb, var(--mm360-ink) 88%, #2a1a56 12%);
	--panel-2: color-mix(in srgb, var(--mm360-ink) 78%, #3a2470 22%);
	--line: color-mix(in srgb, var(--mm360-ink) 55%, #7a5fd6 45%);
	--teal: color-mix(in srgb, var(--mm360-ink) 40%, #8a6fe0 60%);
	--text: #F3EFFB;
	--muted: #A79CD1;
	--accent: var(--mm360-accent);
	--accent-dim: color-mix(in srgb, var(--mm360-accent) 80%, black 20%);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}

#mm360-launcher-wrap {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999999;
	display: flex;
	align-items: center;
	gap: 10px;
}
#mm360-label {
	background: var(--panel, #1C0C46);
	color: var(--text, #F3EFFB);
	border: 1px solid var(--line, #3A2470);
	padding: 9px 14px;
	border-radius: 999px;
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 6px 18px rgba(0,0,0,.35);
	animation: mm360-label-pop .3s ease .2s both;
}
@keyframes mm360-label-pop { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: translateX(0); } }
#mm360-launcher {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #ffffff;
	border: 3px solid var(--accent);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent), 0 2px 8px rgba(0,0,0,.4);
	transition: transform .18s ease, box-shadow .18s ease;
	padding: 7px;
	flex: none;
}
#mm360-launcher:hover { transform: translateY(-2px) scale(1.04); }
#mm360-launcher .mm360-icon-img { width: 100%; height: 100%; object-fit: contain; display: block; }
#mm360-launcher .mm360-dot {
	position: absolute;
	top: -2px;
	right: -2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #E85D3D;
	border: 2px solid var(--mm360-ink);
	z-index: 2;
}

#mm360-panel {
	position: fixed;
	right: 24px;
	bottom: 98px;
	z-index: 999999;
	width: 368px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 140px);
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0,0,0,.5);
	opacity: 0;
	transform: translateY(16px) scale(.98);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
#mm360-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

#mm360-header {
	background: linear-gradient(135deg, color-mix(in srgb, var(--mm360-ink) 70%, #3a2470 30%) 0%, color-mix(in srgb, var(--mm360-ink) 60%, var(--accent-dim) 20%) 100%);
	border-bottom: 1px solid var(--line);
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}
#mm360-header .mm360-avatar {
	width: 36px;
	height: 36px;
	border-radius: 9px;
	flex: none;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
}
#mm360-header .mm360-avatar .mm360-icon-img { width: 100%; height: 100%; object-fit: contain; display: block; }
#mm360-header .mm360-title { font-size: 14.5px; font-weight: 600; line-height: 1.2; color: var(--text); }
#mm360-header .mm360-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
#mm360-header .mm360-status i { width: 6px; height: 6px; border-radius: 50%; background: #4CAF7D; display: inline-block; }
#mm360-close { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; }
#mm360-close:hover { color: var(--text); background: rgba(255,255,255,.08); }
#mm360-close svg { width: 18px; height: 18px; display: block; }

#mm360-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scrollbar-width: thin;
	scrollbar-color: var(--line) transparent;
}
#mm360-body::-webkit-scrollbar { width: 6px; }
#mm360-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

.mm360-row { display: flex; gap: 8px; max-width: 100%; }
.mm360-row.bot { justify-content: flex-start; }
.mm360-row.user { justify-content: flex-end; }
.mm360-bubble {
	padding: 10px 13px;
	border-radius: 13px;
	font-size: 13.6px;
	line-height: 1.55;
	max-width: 82%;
	white-space: pre-wrap;
}
.mm360-row.bot .mm360-bubble { background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--text); }
.mm360-row.user .mm360-bubble { background: var(--teal); border-bottom-right-radius: 4px; color: #EAF5F3; }

.mm360-typing { display: flex; gap: 4px; padding: 4px 2px; }
.mm360-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: mm360-bounce 1.1s infinite ease-in-out; }
.mm360-typing span:nth-child(2) { animation-delay: .15s; }
.mm360-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mm360-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.mm360-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 4px; }
.mm360-chip {
	border: 1px solid var(--accent-dim);
	color: var(--accent);
	background: color-mix(in srgb, var(--accent) 8%, transparent);
	padding: 7px 12px;
	border-radius: 999px;
	font-size: 12.8px;
	cursor: pointer;
	font-family: inherit;
	transition: background .15s ease, transform .1s ease;
}
.mm360-chip:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); transform: translateY(-1px); }
.mm360-chip.alt { border-color: var(--line); color: var(--text); background: var(--panel-2); }
.mm360-chip.alt:hover { background: color-mix(in srgb, var(--panel-2) 80%, white 5%); }
.mm360-chip:focus, .mm360-chip:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

.mm360-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--accent);
	color: #1B1206;
	text-decoration: none;
	padding: 9px 14px;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 600;
	margin-top: 2px;
}
.mm360-link-btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }

#mm360-form { padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.mm360-lead { display: flex; flex-direction: column; gap: 8px; }
.mm360-lead input {
	width: 100%;
	padding: 9px 11px;
	border-radius: 9px;
	border: 1px solid var(--line);
	background: var(--panel-2);
	color: var(--text);
	font-size: 13px;
	font-family: inherit;
}
.mm360-lead input::placeholder { color: var(--muted); }
.mm360-lead input:focus { outline: 2px solid var(--accent-dim); outline-offset: 1px; }
.mm360-lead button {
	background: linear-gradient(160deg, var(--accent), var(--accent-dim));
	color: #1B1206;
	border: none;
	padding: 10px;
	border-radius: 9px;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
}

#mm360-inputbar { display: flex; gap: 8px; padding: 12px 12px 14px; border-top: 1px solid var(--line); background: var(--panel); }
#mm360-input {
	flex: 1;
	background: var(--panel-2);
	border: 1px solid var(--line);
	color: var(--text);
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 13.5px;
	font-family: inherit;
}
#mm360-input:focus { outline: 2px solid var(--accent-dim); outline-offset: 1px; }
#mm360-send {
	background: var(--accent);
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
#mm360-send svg { width: 17px; height: 17px; }
#mm360-send:hover { background: color-mix(in srgb, var(--accent) 85%, white 15%); }

@media (max-width: 420px) {
	#mm360-panel { right: 16px; left: 16px; width: auto; bottom: 90px; }
	#mm360-launcher-wrap { right: 16px; bottom: 16px; }
	#mm360-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	#mm360-panel, #mm360-launcher, .mm360-chip { transition: none; }
	.mm360-typing span { animation: none; }
}
