.sais-app {
	background: #f5f7fb;
	border: 1px solid #e5e9f2;
	border-radius: 8px;
	color: #172033;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	margin: 24px auto;
	max-width: 1120px;
	padding: 24px;
}

.sais-hero {
	align-items: center;
	background: linear-gradient(135deg, #ffffff, #eef4ff);
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	display: flex;
	justify-content: space-between;
	margin-bottom: 18px;
	padding: 24px;
}

.sais-eyebrow {
	color: #2563eb;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	margin: 0 0 6px;
	text-transform: uppercase;
}

.sais-hero h2 {
	font-size: 32px;
	line-height: 1.1;
	margin: 0 0 8px;
}

.sais-hero p:last-child {
	color: #475569;
	margin: 0;
}

.sais-tabs {
	display: flex;
	gap: 8px;
	margin: 0 0 18px;
}

.sais-tabs button,
.sais-actions button,
.sais-history button {
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	color: #172033;
	cursor: pointer;
	font-weight: 700;
	padding: 10px 14px;
	transition: background .2s, border-color .2s, color .2s;
}

.sais-tabs button.is-active,
.sais-actions .sais-primary {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
}

.sais-panel {
	display: none;
	gap: 18px;
	grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
}

.sais-panel.is-active {
	display: grid;
}

.sais-editor,
.sais-preview,
.sais-history {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
	padding: 18px;
}

.sais-app label {
	color: #334155;
	display: block;
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 14px;
}

.sais-app textarea,
.sais-app input[type="text"],
.sais-app input[type="number"],
.sais-app select {
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	box-sizing: border-box;
	display: block;
	font: inherit;
	margin-top: 7px;
	min-height: 42px;
	padding: 10px 12px;
	width: 100%;
}

.sais-app textarea {
	min-height: 118px;
	resize: vertical;
}

.sais-inline {
	align-items: center;
	display: flex !important;
	gap: 8px;
}

.sais-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 12px 0;
}

.sais-status {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	color: #1e40af;
	font-size: 14px;
	padding: 10px 12px;
}

.sais-template-preview {
	align-items: center;
	background: linear-gradient(135deg, #f8fafc, #eef4ff);
	border: 1px solid #dbeafe;
	border-radius: 8px;
	display: grid;
	gap: 6px 10px;
	grid-template-columns: 36px 1fr;
	margin: -4px 0 14px;
	padding: 12px;
}

.sais-template-preview .dashicons {
	align-items: center;
	background: #2563eb;
	border-radius: 8px;
	color: #fff;
	display: flex;
	height: 36px;
	justify-content: center;
	width: 36px;
}

.sais-template-preview strong {
	color: #172033;
	font-size: 14px;
}

.sais-template-preview small {
	color: #64748b;
	grid-column: 2;
	line-height: 1.35;
}

.sais-template-swatches {
	display: flex;
	gap: 4px;
	grid-column: 2;
}

.sais-template-swatches i {
	border: 1px solid rgba(15, 23, 42, .12);
	border-radius: 999px;
	display: block;
	height: 14px;
	width: 14px;
}

.sais-progress {
	margin: 12px 0;
}

.sais-progress > div {
	background: #e2e8f0;
	border-radius: 999px;
	height: 9px;
	overflow: hidden;
}

.sais-progress span {
	background: #2563eb;
	border-radius: 999px;
	display: block;
	height: 100%;
	transition: width .35s ease;
	width: 0;
}

.sais-progress strong {
	color: #1e40af;
	display: inline-block;
	font-size: 13px;
	margin-top: 6px;
}

.sais-progress p {
	color: #475569;
	display: inline-block;
	font-size: 13px;
	margin: 6px 0 0 8px;
}

.sais-progress.is-complete span {
	background: #16a34a;
}

.sais-progress.is-error span {
	background: #dc2626;
}

.sais-empty,
.sais-mock-post,
.sais-mock-reel,
.sais-real-post {
	align-items: center;
	aspect-ratio: 1 / 1;
	background: linear-gradient(135deg, #1e293b, #2563eb);
	border-radius: 8px;
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: center;
	margin-bottom: 16px;
	min-height: 260px;
	padding: 24px;
	text-align: center;
}

.sais-real-post {
	background: #0f172a;
	padding: 0;
	overflow: hidden;
}

.sais-real-post img,
.sais-slide img,
.sais-video-preview video {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.sais-video-preview {
	aspect-ratio: 9 / 16;
	background: #0f172a;
	border-radius: 8px;
	margin-bottom: 16px;
	overflow: hidden;
}

.sais-video-preview video {
	height: 100%;
	width: 100%;
}

.sais-mock-post strong,
.sais-mock-reel strong {
	font-size: 26px;
	margin-bottom: 12px;
}

.sais-carousel-preview {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-bottom: 16px;
}

.sais-slide {
	aspect-ratio: 1 / 1;
	background: #eef4ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	padding: 14px;
	overflow: hidden;
}

.sais-aspect-1-1 {
	aspect-ratio: 1 / 1;
}

.sais-aspect-3-4 {
	aspect-ratio: 3 / 4;
}

.sais-aspect-9-16 {
	aspect-ratio: 9 / 16;
}

.sais-slide h4 {
	font-size: 16px;
	margin: 0 0 8px;
}

.sais-slide p {
	color: #475569;
	font-size: 13px;
	margin: 0;
}

.sais-slide-plan {
	align-items: center;
	background: linear-gradient(135deg, #dbeafe, #f8fafc);
	border: 1px dashed #93c5fd;
	border-radius: 8px;
	color: #1e40af;
	display: flex;
	flex-direction: column;
	gap: 6px;
	justify-content: center;
	min-height: 96px;
	margin-bottom: 10px;
}

.sais-slide-plan .dashicons {
	font-size: 26px;
	height: 26px;
	width: 26px;
}

.sais-history {
	margin-top: 18px;
}

.sais-history__header {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
}

.sais-history h3 {
	margin: 0;
}

.sais-history-item {
	border-top: 1px solid #e2e8f0;
	display: grid;
	gap: 8px;
	grid-template-columns: 56px 90px 150px 1fr 150px;
	padding: 12px 0;
}

.sais-history-item img,
.sais-history-item video {
	border-radius: 6px;
	height: 56px;
	object-fit: cover;
	width: 56px;
}

.sais-media-deleted {
	align-items: center;
	background: #f3f4f6;
	border: 1px dashed #cbd5e1;
	border-radius: 6px;
	color: #64748b;
	display: flex;
	font-size: 12px;
	height: 56px;
	justify-content: center;
	text-align: center;
	width: 56px;
}

.sais-history-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	grid-column: 1 / -1;
}

.sais-history-actions button {
	border-color: #fecaca;
	color: #991b1b;
	font-size: 12px;
	padding: 6px 9px;
}

.sais-history-actions button[data-action="import-generation-media"] {
	border-color: #bfdbfe;
	color: #1e40af;
}

.sais-preview-delete {
	background: #fff;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #991b1b;
	cursor: pointer;
	margin: 10px 0 12px;
	padding: 9px 12px;
}

.sais-preview-import {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	color: #1e40af;
	cursor: pointer;
	margin: 10px 0 12px;
	padding: 9px 12px;
}

.sais-media-deleted--preview {
	aspect-ratio: auto;
	height: auto;
	margin-bottom: 12px;
	min-height: 120px;
	width: 100%;
}

.sais-no-preview {
	align-items: center;
	background: #fef2f2;
	border: 1px dashed #fecaca;
	border-radius: 8px;
	color: #991b1b;
	display: flex;
	flex-direction: column;
	gap: 10px;
	justify-content: center;
	min-height: 180px;
	padding: 18px;
}

.sais-modal[hidden] {
	display: none;
}

.sais-modal {
	align-items: center;
	background: rgba(15, 23, 42, .58);
	display: flex;
	inset: 0;
	justify-content: center;
	position: fixed;
	z-index: 99999;
}

.sais-modal__dialog {
	background: #fff;
	border-radius: 8px;
	max-height: 88vh;
	max-width: 720px;
	overflow: auto;
	padding: 20px;
	position: relative;
	width: min(92vw, 720px);
}

.sais-modal__close {
	background: #f1f5f9;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	font-size: 22px;
	height: 34px;
	position: absolute;
	right: 14px;
	top: 14px;
	width: 34px;
}

.sais-muted {
	color: #64748b;
}

.sais-access-notice {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	border-radius: 8px;
	color: #9a3412;
	margin: 24px auto;
	max-width: 720px;
	padding: 16px;
}

@media (max-width: 760px) {
	.sais-app {
		padding: 14px;
	}

	.sais-panel {
		grid-template-columns: 1fr;
	}

	.sais-tabs {
		overflow-x: auto;
	}

	.sais-carousel-preview,
	.sais-history-item {
		grid-template-columns: 1fr;
	}
}
