.rbaa-auto-container,
.rbaa-shortcode-container,
.rbaa-launch-form {
	display: inline-flex;
	align-items: center;
	margin: 10px 0;
}

.rbaa-launch-form {
	padding: 0;
	border: 0;
	background: transparent;
}

.rbaa-button {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	padding: 9px 15px;
	box-sizing: border-box;
	border: 1px solid #72ae3a;
	border-radius: 10px;
	background: #72ae3a;
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
	box-shadow: 0 5px 16px rgba(0, 0, 0, .10);
	cursor: pointer;
	transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}

.rbaa-button:hover {
	background: #fff;
	color: #000;
	box-shadow: 0 7px 20px rgba(0, 0, 0, .14);
	transform: translateY(-1px);
}

.rbaa-button:focus,
.rbaa-button:focus-visible {
	outline: 3px solid rgba(114, 174, 58, .34);
	outline-offset: 3px;
}

.rbaa-button__icon {
	display: inline-flex;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
}

.rbaa-button__icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

html.rbaa-modal-open,
html.rbaa-modal-open body {
	overflow: hidden;
}

.rbaa-analysis-dialog[hidden],
.rbaa-analysis-dialog:not([open]):not(.rbaa-dialog--legacy-open) {
	display: none !important;
}

.rbaa-analysis-dialog {
	width: min(920px, calc(100vw - 40px));
	max-width: 920px;
	max-height: calc(100vh - 40px);
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: #000;
	overflow: visible;
}

.rbaa-analysis-dialog::backdrop {
	background: rgba(0, 0, 0, .68);
}

.rbaa-analysis-dialog.rbaa-dialog--legacy-open {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2147483647;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: auto;
	max-width: none;
	max-height: none;
	padding: 20px;
	box-sizing: border-box;
	background: rgba(0, 0, 0, .68);
}

.rbaa-analysis-dialog__panel {
	position: relative;
	width: 100%;
	max-height: calc(100vh - 40px);
	overflow: auto;
	box-sizing: border-box;
	padding: 24px;
	border: 1px solid rgba(114, 174, 58, .58);
	border-radius: 16px;
	background: #fff;
	color: #000;
	box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
	-webkit-overflow-scrolling: touch;
}

.rbaa-analysis-dialog__panel h2 {
	margin: 0 48px 10px 0;
	font-size: 22px;
	line-height: 1.3;
}

.rbaa-analysis-dialog__close {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #000;
	color: #fff;
	font-size: 24px;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.rbaa-analysis-dialog__close:focus,
.rbaa-analysis-dialog__close:focus-visible {
	outline: 3px solid rgba(114, 174, 58, .34);
	outline-offset: 3px;
}

.rbaa-analysis-source {
	margin: 0 48px 8px 0;
	color: #505050;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
}

.rbaa-analysis-model {
	margin: 0 48px 18px 0;
	color: #72ae3a;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.4;
}

.rbaa-analysis-interactive[hidden],
.rbaa-analysis-dialog__fallback[hidden],
.rbaa-analysis-status[hidden],
.rbaa-analysis-cache-note[hidden],
.rbaa-analysis-result[hidden],
.rbaa-modal__actions[hidden],
.rbaa-modal__primary[hidden],
.rbaa-modal__secondary[hidden] {
	display: none !important;
}

.rbaa-analysis-dialog__notice {
	margin: 0;
	padding: 14px 16px;
	border: 1px solid rgba(114, 174, 58, .45);
	border-radius: 10px;
	background: rgba(114, 174, 58, .08);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
}

.rbaa-analysis-status {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 56px;
	padding: 14px 16px;
	box-sizing: border-box;
	border: 1px solid rgba(114, 174, 58, .45);
	border-radius: 10px;
	background: rgba(114, 174, 58, .08);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.45;
}

.rbaa-analysis-status--error {
	border-color: #000;
	background: #f4f4f4;
	color: #000;
}

.rbaa-spinner {
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
	border: 3px solid rgba(0, 0, 0, .16);
	border-top-color: #72ae3a;
	border-radius: 50%;
	animation: rbaa-spin .8s linear infinite;
}

.rbaa-analysis-cache-note {
	margin: 0 0 12px;
	padding: 9px 12px;
	border-left: 3px solid #72ae3a;
	background: #f5f8f2;
	color: #303030;
	font-size: 12px;
	line-height: 1.45;
}

.rbaa-analysis-result {
	width: 100%;
	max-height: 64vh;
	margin: 0;
	padding: 18px;
	overflow: auto;
	box-sizing: border-box;
	border: 1px solid #d5d5d5;
	border-radius: 10px;
	background: #fafafa;
	color: #000;
	font: 14px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	word-break: break-word;
}

.rbaa-analysis-result section {
	margin: 0 0 20px;
	padding: 0 0 20px;
	border-bottom: 1px solid #e2e2e2;
}

.rbaa-analysis-result section:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.rbaa-analysis-result__heading {
	margin: 0 0 10px;
	font-size: 18px;
	line-height: 1.35;
}

.rbaa-analysis-result p {
	margin: 0 0 10px;
}

.rbaa-analysis-result ul {
	margin: 0;
	padding-left: 22px;
}

.rbaa-analysis-result li {
	margin: 0 0 8px;
}

.rbaa-analysis-cards {
	display: grid;
	gap: 12px;
}

.rbaa-analysis-card,
.rbaa-classification {
	padding: 14px;
	border: 1px solid #ddd;
	border-radius: 10px;
	background: #fff;
}

.rbaa-analysis-card h4 {
	margin: 0 0 6px;
	font-size: 15px;
	line-height: 1.4;
}

.rbaa-analysis-card p,
.rbaa-classification p {
	margin: 0;
}

.rbaa-classification-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.rbaa-classification span {
	display: inline-block;
	margin-bottom: 8px;
	padding: 2px 8px;
	border-radius: 999px;
	background: #72ae3a;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .03em;
}

.rbaa-classification strong {
	display: block;
	margin-bottom: 6px;
}

.rbaa-reliability {
	padding-left: 14px !important;
	border-left: 4px solid #72ae3a !important;
}

.rbaa-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

.rbaa-modal__primary,
.rbaa-modal__secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 9px 15px;
	box-sizing: border-box;
	border-radius: 9px;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.rbaa-modal__primary {
	border: 1px solid #72ae3a;
	background: #72ae3a;
	color: #fff;
}

.rbaa-modal__secondary {
	border: 1px solid #000;
	background: #fff;
	color: #000;
}

.rbaa-modal__primary:hover,
.rbaa-modal__secondary:hover {
	filter: brightness(.97);
}

.rbaa-toast {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 2147483647;
	max-width: calc(100vw - 36px);
	padding: 13px 16px;
	box-sizing: border-box;
	border-left: 4px solid #72ae3a;
	border-radius: 10px;
	background: #000;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
	box-shadow: 0 12px 38px rgba(0, 0, 0, .28);
	opacity: 0;
	transform: translateY(10px);
	transition: opacity .2s ease, transform .2s ease;
}

.rbaa-toast--error {
	border-left-color: #fff;
}

.rbaa-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.rbaa-fallback-form {
	display: none !important;
}

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

@media (max-width: 600px) {
	.rbaa-button,
	.rbaa-auto-container,
	.rbaa-shortcode-container,
	.rbaa-launch-form {
		width: 100%;
	}

	.rbaa-auto-container,
	.rbaa-shortcode-container,
	.rbaa-launch-form {
		display: flex;
	}

	.rbaa-analysis-dialog {
		width: calc(100vw - 20px);
		max-height: calc(100vh - 20px);
	}

	.rbaa-analysis-dialog__panel {
		max-height: calc(100vh - 20px);
		padding: 20px;
		border-radius: 12px;
	}

	.rbaa-modal__actions > * {
		width: 100%;
	}

	.rbaa-analysis-result {
		max-height: 60vh;
		padding: 14px;
	}

	.rbaa-classification-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rbaa-button,
	.rbaa-toast {
		transition: none;
	}

	.rbaa-spinner {
		animation-duration: 1.8s;
	}
}
