.rmg-app {
	font-family: var(--wp--preset--font-family--body, 'Inter', sans-serif);
	color: #0f172a;
}

.rmg-card {
	background: #fff;
	border-radius: 28px;
	padding: clamp(1.5rem, 4vw, 3rem);
	border: 1px solid rgba(15, 23, 42, 0.08);
	box-shadow: 0 30px 80px rgba(15, 23, 42, 0.1);
	max-width: 760px;
	margin: 0 auto;
}

@media (prefers-color-scheme: dark) {
	.rmg-card {
		background: #0f172a;
		border-color: rgba(148, 163, 184, 0.3);
		box-shadow: 0 35px 70px rgba(0, 0, 0, 0.6);
		color: #f8fafc;
	}
}

.rmg-card__header {
	margin-bottom: 1.25rem;
}

.rmg-title {
	margin: 0 0 0.25rem;
	font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.rmg-intro {
	margin: 0;
	color: #475569;
}

.rmg-form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	margin-bottom: 1.25rem;
}

.rmg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
}

.rmg-field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.rmg-field input,
.rmg-field select {
	border-radius: 16px;
	border: 1px solid rgba(15, 23, 42, 0.15);
	padding: 0.85rem 1rem;
	font-size: 1rem;
	font-family: inherit;
	background: rgba(248, 250, 252, 0.9);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rmg-field input:focus,
.rmg-field select:focus {
	outline: none;
	border-color: #7c3aed;
	box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}

.rmg-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.rmg-button {
	border: none;
	border-radius: 999px;
	padding: 0.85rem 1.8rem;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rmg-button--primary {
	background: linear-gradient(135deg, #7c3aed, #2563eb);
	color: #fff;
	box-shadow: 0 20px 35px rgba(79, 70, 229, 0.35);
}

.rmg-button--primary:disabled {
	opacity: 0.5;
	cursor: progress;
}

.rmg-button:not(.rmg-button--primary) {
	background: rgba(15, 23, 42, 0.08);
	color: inherit;
}

.rmg-button:hover:not(:disabled) {
	transform: translateY(-2px);
}

.rmg-status {
	margin-top: 0.35rem;
	border-radius: 18px;
	padding: 0.75rem 1rem;
	background: rgba(124, 58, 237, 0.1);
	color: #4c1d95;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.rmg-status[hidden] {
	display: none;
}

.rmg-status.is-loading::before {
	content: '';
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	border: 2px solid rgba(124, 58, 237, 0.4);
	border-top-color: #7c3aed;
	animation: rmg-spin 0.8s linear infinite;
}

.rmg-status.is-error {
	background: rgba(239, 68, 68, 0.12);
	color: #991b1b;
}

.rmg-result {
	margin-top: 1.5rem;
}

.rmg-result-list {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.rmg-result-card {
	border-radius: 24px;
	border: 1px solid rgba(15, 23, 42, 0.08);
	padding: 1.5rem;
	background: rgba(248, 250, 252, 0.9);
	box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
	display: grid;
	gap: 1rem;
}

.rmg-result-top {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
}

.rmg-poster {
	width: 140px;
	height: 210px;
	border-radius: 18px;
	object-fit: cover;
	box-shadow: 0 15px 40px rgba(15, 23, 42, 0.3);
	background: linear-gradient(135deg, #38bdf8, #3b82f6);
}

.rmg-poster--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.5rem;
	color: #fff;
}

.rmg-details h3 {
	margin: 0 0 0.35rem;
	font-size: 1.5rem;
}

.rmg-details p {
	margin: 0 0 0.6rem;
	color: #475569;
}

.rmg-meta {
	font-weight: 600;
	color: #0f172a;
}

.rmg-chip {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	padding: 0.2rem 0.85rem;
	background: rgba(234, 179, 8, 0.15);
	color: #b45309;
	font-weight: 600;
	font-size: 0.85rem;
	margin-bottom: 0.5rem;
}

.rmg-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.rmg-tags span {
	border-radius: 12px;
	padding: 0.25rem 0.85rem;
	font-size: 0.8rem;
	background: rgba(15, 23, 42, 0.08);
	color: #334155;
}

.rmg-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.rmg-link {
	padding: 0.65rem 1.25rem;
	border-radius: 12px;
	background: #2563eb;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rmg-link:hover {
	transform: translateY(-2px);
	box-shadow: 0 15px 30px rgba(37, 99, 235, 0.4);
}

.rmg-link--amazon {
	background: linear-gradient(135deg, #f97316, #ec4899);
	border: none;
	box-shadow: 0 15px 30px rgba(236, 72, 153, 0.35);
}

.rmg-link--amazon:hover {
	box-shadow: 0 18px 35px rgba(236, 72, 153, 0.45);
}

.rmg-link--outline {
	background: transparent;
	border: 1px solid rgba(37, 99, 235, 0.4);
	color: #2563eb;
}

@media (max-width: 640px) {
	.rmg-result-top {
		flex-direction: column;
	}

	.rmg-poster {
		width: 100%;
		height: auto;
		aspect-ratio: 2 / 3;
	}

	.rmg-result-list {
		gap: 1rem;
	}
}

@keyframes rmg-spin {
	to {
		transform: rotate(360deg);
	}
}
