/*
 * AI Studio admin styles. Every rule is scoped to .wpbot-studio-wrap so other
 * admin screens are never affected. Uses WordPress admin colours and spacing;
 * no second UI framework.
 */
.wpbot-studio-wrap .wpbot-studio-title {
	margin-bottom: 16px;
}

.wpbot-studio-wrap .wpbot-studio-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	margin-top: 16px;
}

.wpbot-studio-wrap .wpbot-studio-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 16px 20px;
}

.wpbot-studio-wrap .wpbot-studio-card h2 {
	margin-top: 0;
	font-size: 15px;
}

.wpbot-studio-wrap .wpbot-studio-counts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wpbot-studio-wrap .wpbot-studio-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	line-height: 18px;
	background: #f0f0f1;
	color: #1d2327;
}

.wpbot-studio-wrap .wpbot-studio-badge.is-ok {
	background: #edfaef;
	color: #00450c;
}

.wpbot-studio-wrap .wpbot-studio-badge.is-warn {
	background: #fcf9e8;
	color: #614200;
}

.wpbot-studio-wrap .wpbot-studio-badge.is-fail {
	background: #fcf0f1;
	color: #8a2424;
}

.wpbot-studio-wrap .wpbot-studio-diagnostics td {
	vertical-align: top;
}

.wpbot-studio-wrap .wpbot-studio-tabs {
	margin-bottom: 16px;
}

.wpbot-studio-wrap .wpbot-studio-notice {
	margin: 12px 0;
}

.wpbot-studio-wrap .wpbot-studio-badge.is-info {
	background: #f0f6fc;
	color: #0a4b78;
}

.wpbot-studio-wrap .wpbot-studio-actions .button {
	margin: 0 4px 4px 0;
}

.wpbot-studio-wrap .wpbot-studio-result {
	white-space: pre-line;
}

.wpbot-studio-wrap .wpbot-studio-result.is-ok {
	color: #00450c;
}

.wpbot-studio-wrap .wpbot-studio-result.is-fail {
	color: #8a2424;
}

.wpbot-studio-wrap .wpbot-studio-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 8px 0 12px;
}

.wpbot-studio-wrap .wpbot-studio-library {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wpbot-studio-wrap .wpbot-studio-asset {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 12px;
	margin: 0;
}

.wpbot-studio-wrap .wpbot-studio-asset-media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	background: #f6f7f7;
	overflow: hidden;
	margin-bottom: 8px;
}

.wpbot-studio-wrap .wpbot-studio-asset-media img,
.wpbot-studio-wrap .wpbot-studio-asset-media video {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.wpbot-studio-wrap .wpbot-studio-asset-actions {
	margin-top: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.wpbot-studio-wrap [hidden] {
	display: none !important;
}

/* AI setup: readiness, required fields, inline editing, source size hint. */
.wpbot-studio-wrap .wpbot-studio-readiness {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	margin: 12px 0 8px;
}

.wpbot-studio-wrap .wpbot-studio-readiness li {
	margin: 0;
}

.wpbot-studio-wrap .wpbot-studio-required {
	color: #d63638;
	font-weight: 600;
}

.wpbot-studio-wrap .is-invalid {
	border-color: #d63638 !important;
	box-shadow: 0 0 0 1px #d63638 !important;
	background-color: #fcf0f1;
}

.wpbot-studio-wrap .wpbot-studio-task-table .wpbot-studio-field {
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 16px 8px 0;
	vertical-align: top;
	max-width: 100%;
}

.wpbot-studio-wrap .wpbot-studio-task-table .wpbot-studio-field[data-wpbot-studio-request-model] {
	display: flex;
	max-width: 640px;
}

.wpbot-studio-wrap .wpbot-studio-task-table .wpbot-studio-field[hidden] {
	display: none;
}

.wpbot-studio-wrap .wpbot-studio-task-table th .wpbot-studio-badge {
	margin-left: 4px;
	font-weight: 400;
}

.wpbot-studio-wrap .wpbot-studio-size-hint {
	display: flex;
	gap: 6px;
	align-items: flex-start;
	max-width: 760px;
	margin: 4px 0 0;
	padding: 8px 12px;
	border-left: 4px solid #72aee6;
	background: #f0f6fc;
}

.wpbot-studio-wrap .wpbot-studio-edit-row > td {
	background: #f6f7f7;
	border-top: 0;
}

.wpbot-studio-wrap .wpbot-studio-edit-row .form-table {
	margin-top: 0;
}

.wpbot-studio-wrap details.wpbot-studio-add-connection,
.wpbot-studio-wrap details.wpbot-studio-advanced {
	margin: 16px 0;
}

.wpbot-studio-wrap details.wpbot-studio-add-connection > summary,
.wpbot-studio-wrap details.wpbot-studio-advanced > summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
}

/* Connections: section header, "Active for" boxes, add-from-task row. */
.wpbot-studio-wrap .wpbot-studio-section-head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wpbot-studio-wrap .wpbot-studio-section-head .dashicons {
	vertical-align: middle;
	margin-top: -2px;
}

.wpbot-studio-wrap .wpbot-studio-active-for .wpbot-studio-active-box {
	display: block;
	white-space: nowrap;
	margin: 0 0 4px;
}

.wpbot-studio-wrap .wpbot-studio-active-for .wpbot-studio-active-box.is-disabled {
	color: #8c8f94;
	cursor: help;
}

.wpbot-studio-wrap .wpbot-studio-add-connection {
	margin: 12px 0 16px;
	padding: 4px 16px 8px;
	background: #fff;
	border: 1px solid #dcdcde;
}

.wpbot-studio-wrap .wpbot-studio-add-row > td {
	padding: 4px 16px 8px;
	background: #fff;
	border: 1px solid #72aee6;
}

/* Asset Library: selection, viewer and bulk actions */
.wpbot-studio-wrap .wpbot-studio-asset {
	position: relative;
}

.wpbot-studio-wrap .wpbot-studio-asset-check {
	position: absolute;
	top: 6px;
	left: 6px;
	z-index: 2;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 3px;
	padding: 2px 4px;
}

.wpbot-studio-wrap button.wpbot-studio-asset-media {
	position: relative;
	width: 100%;
	border: 0;
	padding: 0;
	cursor: zoom-in;
}

.wpbot-studio-wrap button.wpbot-studio-asset-media:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.wpbot-studio-wrap .wpbot-studio-play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 40px;
	height: 40px;
	font-size: 40px;
	color: #fff;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.wpbot-studio-wrap .wpbot-studio-bulkbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
	margin: 8px 0 12px;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.wpbot-studio-wrap .wpbot-studio-progress progress {
	vertical-align: middle;
	width: 180px;
}

.wpbot-studio-viewer-media {
	display: block;
	max-width: 100%;
	max-height: 70vh;
	margin: 0 auto;
	background: #f6f7f7;
}

/* Dialogs on admin pages (the Studio apps have their own copy) */
.wps-dialog {
	width: min(860px, 94vw);
	max-height: 92vh;
	border: 0;
	border-radius: 4px;
	padding: 20px 24px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.wps-dialog::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.wps-dialog h2 {
	margin-top: 0;
}

.wps-dialog-buttons {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	margin-top: 16px;
}

.wps-dialog-error {
	color: #8a2424;
}

.wps-dialog [hidden] {
	display: none !important;
}

.wps-danger {
	color: #b32d2e !important;
	border-color: #b32d2e !important;
}

/* Error log and clean-up */
.wpbot-studio-wrap .wpbot-studio-log-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	align-items: center;
	margin: 8px 0;
}

.wpbot-studio-wrap .wpbot-studio-log-table td,
.wpbot-studio-wrap .wpbot-studio-log-table th {
	vertical-align: top;
	word-break: break-word;
}

.wpbot-studio-wrap .wpbot-studio-log-table tr.is-error td:last-child {
	color: #8a2424;
}

.wpbot-studio-wrap .wpbot-studio-log-pages {
	display: flex;
	gap: 8px;
	align-items: center;
}

.wpbot-studio-wrap .wpbot-studio-cleanup-preview {
	max-width: 760px;
	margin: 8px 0;
}

.wpbot-studio-wrap .wpbot-studio-long-video {
	margin-top: 8px;
}

.wpbot-studio-wrap .wpbot-studio-long-video .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	vertical-align: text-bottom;
}

/* Short tag next to a card title or settings tab label (the "badge" field). */
.wpbot-studio-tag {
	display: inline-block;
	margin-left: 6px;
	padding: 0 6px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	vertical-align: middle;
	background: #f0f6fc;
	color: #2271b1;
}

.wpbot-studio-wrap .wpbot-studio-bulkbar option[data-display-only] {
	color: #8c8f94;
}
