.rbg-app {
	font-family: var(--wp--preset--font-family--body, inherit);
	color: var(--wp--preset--color--contrast, #0f172a);
}

.rbg-card {
	background: #ffffff;
	border-radius: 20px;
	padding: clamp(1.5rem, 3vw, 2.75rem);
	box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
	border: 1px solid #e2e8f0;
}

@media (prefers-color-scheme: dark) {
	.rbg-card {
		background: #0f172a;
		color: #f8fafc;
		border-color: rgba(148, 163, 184, 0.4);
		box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
	}
}

.rbg-card__header {
	margin-bottom: 1.5rem;
}

.rbg-title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.6rem, 3.2vw, 2.4rem);
}

.rbg-intro {
	margin: 0;
	color: #475569;
	font-size: 1rem;
}

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

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

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

.rbg-field select,
.rbg-field input {
	width: 100%;
	padding: 0.85rem 1rem;
	border-radius: 14px;
	border: 1px solid #cbd5f5;
	font-size: 1rem;
	font-family: inherit;
	background: rgba(248, 250, 252, 0.8);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rbg-field select:focus,
.rbg-field input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

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

.rbg-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;
}

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

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

.rbg-button--ghost {
	background: rgba(148, 163, 184, 0.15);
	color: inherit;
}

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

.rbg-status {
	margin-top: 0.5rem;
	border-radius: 16px;
	padding: 0.9rem 1.2rem;
	background: rgba(37, 99, 235, 0.08);
	color: #1e293b;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.rbg-status.is-error {
	background: rgba(239, 68, 68, 0.12);
	color: #7f1d1d;
}

.rbg-status.is-loading::before {
	content: '';
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	border: 2px solid rgba(37, 99, 235, 0.35);
	border-top-color: #2563eb;
	animation: rbg-spin 0.8s linear infinite;
}

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

.rbg-result-list {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	max-width: 720px;
	margin: 0 auto;
	width: 100%;
}

.rbg-book-card {
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: 24px;
	padding: clamp(1.25rem, 2vw, 1.75rem);
	background: rgba(248, 250, 252, 0.97);
	box-shadow: 0 25px 55px rgba(15, 23, 42, 0.12);
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.rbg-book {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
}

.rbg-book__cover {
	width: 120px;
	height: 180px;
	border-radius: 12px;
	object-fit: cover;
	background: linear-gradient(135deg, #c7d2fe, #c4b5fd);
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
}

.rbg-book__cover--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	color: #fff;
	text-align: center;
	padding: 0.75rem;
}

.rbg-book__meta h3 {
	margin: 0 0 0.25rem;
	font-size: 1.35rem;
}

.rbg-book__meta p {
	margin: 0;
	color: #475569;
}

.rbg-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.85rem;
}

.rbg-tag {
	display: inline-flex;
	align-items: center;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.2rem 0.8rem;
	border-radius: 999px;
	background: rgba(148, 163, 184, 0.2);
	color: #334155;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.rbg-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.25rem;
}

.rbg-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.65rem 1.1rem;
	border-radius: 14px;
	border: 1px solid rgba(37, 99, 235, 0.3);
	color: #2563eb;
	text-decoration: none;
	font-weight: 600;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.rbg-link:hover {
	background: rgba(37, 99, 235, 0.08);
	transform: translateY(-1px);
}

.rbg-link--amazon {
	background: linear-gradient(135deg, #f97316, #ec4899);
	color: #fff;
	border-color: transparent;
	box-shadow: 0 15px 30px rgba(236, 72, 153, 0.35);
	padding: 0.7rem 1.4rem;
}

.rbg-link--amazon:hover {
	background: linear-gradient(135deg, #fb923c, #f472b6);
	box-shadow: 0 18px 35px rgba(236, 72, 153, 0.45);
}

@media (max-width: 640px) {
	.rbg-book {
		flex-direction: column;
	}
}

@media (prefers-color-scheme: dark) {
	.rbg-book-card {
		background: rgba(15, 23, 42, 0.95);
		border-color: rgba(148, 163, 184, 0.4);
		box-shadow: 0 25px 45px rgba(0, 0, 0, 0.6);
	}

	.rbg-tag {
		background: rgba(59, 130, 246, 0.18);
		color: #cbd5f5;
	}

	.rbg-link--amazon {
		box-shadow: 0 18px 35px rgba(248, 113, 113, 0.45);
	}

	.rbg-status.is-loading::before {
		border-color: rgba(148, 163, 184, 0.45);
		border-top-color: #93c5fd;
	}
}

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