.rxai_popup_root {
	position: relative;
	z-index: 99990;
}

.rxai_popup_item {
	position: fixed;
	left: var(--rxai-popup-x, 100px);
	top: var(--rxai-popup-y, 100px);
	width: var(--rxai-popup-w, 400px);
	height: var(--rxai-popup-h, auto);
	display: block;
	z-index: 99991;
	overflow: auto;
	background: #fff;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
	box-sizing: border-box;
	max-width: calc(100vw - 20px);
	max-height: calc(100vh - 20px);
}

.rxai_popup_item.is_fit_image {
	width: auto;
	height: auto;
	max-width: calc(100vw - 16px);
	max-height: calc(100vh - 16px);
}

.rxai_popup_item.is_fit_image .rxai_popup_item_link {
	display: inline-block;
	max-width: 100%;
}

.rxai_popup_item.is_fit_image .rxai_popup_item_media {
	width: auto;
	height: auto;
	max-width: calc(100vw - 16px);
	max-height: calc(100vh - 72px);
}

.rxai_popup_item_inner {
	display: block;
	position: relative;
	height: 100%;
}

.rxai_popup_item_link {
	display: block;
}

.rxai_popup_item_media {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

.rxai_popup_item_content {
	display: block;
	padding: 16px;
	box-sizing: border-box;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.rxai_popup_item_content img {
	max-width: 100%;
	height: auto;
}

.rxai_popup_item_bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	background: #111;
	color: #fff;
	font-size: 13px;
}

.btn_popup_today,
.btn_popup_close {
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	font-size: 13px;
	padding: 4px 6px;
}

.btn_popup_today:hover,
.btn_popup_close:hover {
	text-decoration: underline;
}

@media (max-width: 767px) {
	.rxai_popup_root {
		position: fixed;
		inset: 0;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 12px;
		padding: 12px;
		padding-top: max(12px, env(safe-area-inset-top));
		padding-bottom: max(12px, env(safe-area-inset-bottom));
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: rgba(0, 0, 0, 0.45);
	}

	.rxai_popup_item {
		position: relative;
		left: auto;
		top: auto;
		width: 100%;
		max-width: 100%;
		height: auto;
		max-height: none;
		margin: 0 auto;
		overflow: visible;
	}

	.rxai_popup_item.is_fit_image {
		width: 100%;
		max-width: 100%;
		height: auto;
		max-height: none;
	}

	.rxai_popup_item.is_fit_image .rxai_popup_item_media {
		width: 100% !important;
		height: auto !important;
		max-width: 100%;
		max-height: none;
	}

	.rxai_popup_item_inner {
		height: auto;
	}

	.rxai_popup_item_content {
		padding: 14px;
		font-size: 15px;
		line-height: 1.5;
	}

	.rxai_popup_item_bar {
		position: sticky;
		bottom: 0;
		font-size: 14px;
		min-height: 44px;
	}

	.btn_popup_today,
	.btn_popup_close {
		font-size: 14px;
		min-height: 44px;
		padding: 8px 10px;
	}
}
