/* FlexiType Demo viewer */
:root {
	/* Standalone (themeless) page — declare brand tokens so colors match the site. */
	--brand: #3FA34D;
	--brand-dark: #34883F;
	--brand-tint: #ECF6EE;
}
* { box-sizing: border-box; }
html, body.ftdemo-body { margin: 0; padding: 0; height: 100%; }
.ftdemo-body {
	font-family: 'Mulish', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: #eef1f6;
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
}

/* ---- top bar ---- */
.ftdemo-bar {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 56px;
	padding: 0 14px;
	background: #151b2e;
	color: #fff;
}
.ftdemo-bar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ftdemo-bar__center { display: flex; align-items: center; gap: 4px; }
.ftdemo-bar__right { display: flex; align-items: center; gap: 10px; }

.ftdemo-back {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 8px; color: #cbd2e0; text-decoration: none;
	transition: background .15s, color .15s; flex: none;
}
.ftdemo-back:hover { background: rgba(255,255,255,.1); color: #fff; }

.ftdemo-title {
	font-size: 15px; font-weight: 600; color: #fff;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw;
}

.ftdemo-select select {
	background: #20283f; color: #fff; border: 1px solid #2e3754;
	border-radius: 8px; padding: 7px 30px 7px 12px; font-size: 13px; cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cbd2e0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 10px center;
}

.ftdemo-dev {
	display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 34px; border: 0; background: transparent; color: #8b93a7;
	border-radius: 8px; cursor: pointer; transition: background .15s, color .15s;
}
.ftdemo-dev:hover { color: #fff; background: rgba(255,255,255,.08); }
.ftdemo-dev.is-active { color: #fff; background: var(--brand, #3FA34D); }

.ftdemo-open {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: 8px; color: #cbd2e0; text-decoration: none;
	transition: background .15s, color .15s;
}
.ftdemo-open:hover { background: rgba(255,255,255,.1); color: #fff; }

.ftdemo-buy {
	display: inline-flex; align-items: center; height: 38px; padding: 0 20px;
	background: var(--brand, #3FA34D); color: #fff; font-size: 14px; font-weight: 700;
	border-radius: 9px; text-decoration: none; white-space: nowrap;
	transition: background .15s;
}
.ftdemo-buy:hover { background: #00a85f; }

/* ---- stage + iframe ---- */
.ftdemo-stage {
	flex: 1; position: relative; overflow: auto;
	display: flex; align-items: flex-start; justify-content: center;
	padding: 0;
}
.ftdemo-frame-wrap {
	width: 100%; height: 100%;
	transition: width .3s ease, margin .3s ease, box-shadow .3s ease, border-radius .3s ease;
	background: #fff;
}
.ftdemo-frame-wrap[data-mode="768"],
.ftdemo-frame-wrap[data-mode="390"] {
	margin: 22px auto;
	height: calc(100% - 44px);
	box-shadow: 0 10px 40px rgba(16,24,40,.18);
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid #d8dde8;
}
.ftdemo-frame-wrap[data-mode="768"] { width: 768px; max-width: calc(100% - 32px); }
.ftdemo-frame-wrap[data-mode="390"] { width: 390px; max-width: calc(100% - 32px); }

.ftdemo-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* ---- loading ---- */
.ftdemo-loading {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	background: #eef1f6; pointer-events: none; opacity: 1; transition: opacity .3s;
}
.ftdemo-loading.is-hidden { opacity: 0; }
.ftdemo-spin {
	width: 34px; height: 34px; border: 3px solid #cdd4e0; border-top-color: var(--brand, #3FA34D);
	border-radius: 50%; animation: ftdemo-spin 0.8s linear infinite;
}
@keyframes ftdemo-spin { to { transform: rotate(360deg); } }

/* ---- mobile bar ---- */
/* tablets: device toggles still useful, tighten spacing */
@media (max-width: 900px) {
	.ftdemo-title { max-width: 28vw; }
	.ftdemo-bar { gap: 8px; padding: 0 10px; }
	.ftdemo-bar__left { gap: 8px; }
}

/* phones: hide device toggles (the device IS the preview), compact bar */
@media (max-width: 720px) {
	.ftdemo-bar { height: 52px; }
	.ftdemo-title { max-width: 34vw; font-size: 14px; }
	.ftdemo-bar__center { display: none; }
	.ftdemo-buy { padding: 0 12px; font-size: 13px; height: 34px; }
	.ftdemo-select select { max-width: 110px; padding: 6px 26px 6px 10px; }
	/* tablet/mobile preview frames go full-bleed on a phone — no point boxing them */
	.ftdemo-frame-wrap[data-mode="768"],
	.ftdemo-frame-wrap[data-mode="390"] {
		width: 100% !important; max-width: 100% !important;
		margin: 0; height: 100%; border-radius: 0; border: 0; box-shadow: none;
	}
}

/* very small phones: drop the demo dropdown label width further, hide open icon */
@media (max-width: 480px) {
	.ftdemo-title { max-width: 40vw; }
	.ftdemo-select select { max-width: 92px; }
	.ftdemo-open { display: none; }
}

/* blocked-frame fallback */
.ftdemo-fallback { text-align: center; padding: 24px; max-width: 90%; }
.ftdemo-fallback p { margin: 0 0 16px; color: #475467; font-size: 15px; }
.ftdemo-fallback .ftdemo-buy { display: inline-flex; }
