/**
 * FT Design System — Neutral Premium v1
 * Foundation layer for FT-owned interfaces. No page-specific components here.
 */

/* Predictable sizing for FT-owned UI without touching unrelated wp-admin screens. */
[class^="ft-"],
[class^="ft-"]::before,
[class^="ft-"]::after,
[class*=" ft-"],
[class*=" ft-"]::before,
[class*=" ft-"]::after {
	box-sizing: border-box;
}

/* Foundation typography helpers. Existing page rules keep precedence during migration. */
.ft-ui,
.ft-admin-shell {
	font-family: var(--ft-font-family-base);
	color: var(--ft-color-text-primary);
	line-height: var(--ft-line-height-normal);
}

.ft-surface {
	background: var(--ft-color-surface);
	color: var(--ft-color-text-primary);
}

.ft-surface--subtle {
	background: var(--ft-color-surface-subtle);
}

.ft-surface--warm {
	background: var(--ft-color-surface-warm);
}

.ft-text-secondary { color: var(--ft-color-text-secondary); }
.ft-text-muted { color: var(--ft-color-text-muted); }

/* Accessible focus foundation for new FT controls. Legacy controls are migrated gradually. */
.ft-focusable:focus {
	outline: none;
}

.ft-focusable:focus-visible {
	outline: var(--ft-focus-width) solid var(--ft-color-focus);
	outline-offset: var(--ft-focus-offset);
}

/* Screen-reader-only content. !important is intentional for accessibility robustness. */
.ft-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.ft-visually-hidden--focusable:focus,
.ft-visually-hidden--focusable:focus-visible {
	position: static !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	overflow: visible !important;
	clip: auto !important;
	white-space: normal !important;
}

/* New FT motion must respect the user's reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
	.ft-ui *,
	.ft-ui *::before,
	.ft-ui *::after,
	.ft-admin-shell *,
	.ft-admin-shell *::before,
	.ft-admin-shell *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}


/* =========================================================
 * FT Cards v1 — global, opt-in foundation
 * Specialized cards inherit this contract and override tokens,
 * never business values or page-specific behavior.
 * ======================================================= */
.ft-card {
	display: flex;
	flex-direction: column;
	gap: var(--ft-card-gap);
	min-width: 0;
	padding: var(--ft-card-padding);
	border: var(--ft-card-border-width) solid var(--ft-card-border);
	border-radius: var(--ft-card-radius);
	background: var(--ft-card-bg);
	color: var(--ft-color-text-primary);
	box-shadow: var(--ft-card-shadow);
	transition: border-color var(--ft-card-transition) var(--ft-ease-standard), box-shadow var(--ft-card-transition) var(--ft-ease-standard), transform var(--ft-card-transition) var(--ft-ease-standard);
}

.ft-card--interactive { cursor: pointer; }
.ft-card--interactive:hover {
	border-color: var(--ft-card-hover-border);
	box-shadow: var(--ft-card-shadow-hover);
}
.ft-card--interactive:focus-visible {
	outline: var(--ft-focus-width) solid var(--ft-color-focus);
	outline-offset: var(--ft-focus-offset);
}

.ft-card__header { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--ft-space-3); min-width:0; }
.ft-card__body { display:flex; flex-direction:column; gap:var(--ft-space-2); min-width:0; }
.ft-card__footer { display:flex; align-items:center; justify-content:space-between; gap:var(--ft-space-3); margin-top:auto; min-width:0; }
.ft-card__title { margin:0; color:var(--ft-card-title-color); font-size:var(--ft-font-size-card-title); font-weight:var(--ft-font-weight-semibold); line-height:var(--ft-line-height-tight); }
.ft-card__description { margin:0; color:var(--ft-card-description-color); font-size:var(--ft-font-size-body); line-height:var(--ft-line-height-normal); }
.ft-card__meta { color:var(--ft-card-meta-color); font-size:var(--ft-font-size-sm); line-height:var(--ft-line-height-normal); }
.ft-card__value { color:var(--ft-card-title-color); font-size:var(--ft-font-size-value); font-weight:var(--ft-font-weight-bold); line-height:var(--ft-line-height-tight); }
.ft-card__link { color:var(--ft-card-link-color); font-size:var(--ft-font-size-body); font-weight:var(--ft-font-weight-semibold); text-decoration:none; }
.ft-card__link:hover { color:var(--ft-card-link-hover-color); text-decoration:underline; }
.ft-card__link:focus-visible { outline:var(--ft-focus-width) solid var(--ft-color-focus); outline-offset:var(--ft-focus-offset); border-radius:var(--ft-radius-sm); }

/* Inheritance hooks for the specialized cards planned in the Design System. */
.ft-card--sol { --ft-card-accent: var(--ft-color-info); --ft-card-accent-soft: var(--ft-color-info-soft); }
.ft-card--opportunity { --ft-card-accent: var(--ft-color-warning); --ft-card-accent-soft: var(--ft-color-warning-soft); }
.ft-card--wallet { --ft-card-accent: var(--ft-color-success); --ft-card-accent-soft: var(--ft-color-success-soft); }
.ft-card--package { --ft-card-accent: var(--ft-color-accent); --ft-card-accent-soft: var(--ft-color-accent-soft); }
.ft-card--dashboard,
.ft-card--finance,
.ft-card--status { --ft-card-accent: var(--ft-color-primary); --ft-card-accent-soft: var(--ft-color-surface-subtle); }
.ft-card__accent { color:var(--ft-card-accent, var(--ft-color-primary)); }
.ft-card__accent-surface { background:var(--ft-card-accent-soft, var(--ft-color-surface-subtle)); }

@media (max-width: 782px) {
	.ft-card { --ft-card-padding: var(--ft-space-4); }
	.ft-card__header, .ft-card__footer { flex-wrap:wrap; }
}


/* =========================================================
 * FT Specialized Cards v1 — SOL + Opportunity
 * Visual semantics only. Business values/status remain owned
 * by their domain modules.
 * ======================================================= */
.ft-card--sol,
.ft-card--opportunity {
	position: relative;
	overflow: hidden;
}

.ft-card--sol {
	--ft-card-accent: var(--ft-card-sol-accent);
	--ft-card-accent-soft: var(--ft-card-sol-accent-soft);
}

.ft-card--opportunity {
	--ft-card-accent: var(--ft-card-opportunity-accent);
	--ft-card-accent-soft: var(--ft-card-opportunity-accent-soft);
}

/* A narrow semantic strip adds identity while the card surface stays neutral. */
.ft-card--sol::before,
.ft-card--opportunity::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--ft-card-specialized-strip-width);
	background: var(--ft-card-accent);
}

.ft-card__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--ft-space-2);
	width: fit-content;
	max-width: 100%;
	margin: 0;
	color: var(--ft-card-accent);
	font-size: var(--ft-font-size-sm);
	font-weight: var(--ft-font-weight-semibold);
	line-height: var(--ft-line-height-tight);
}

.ft-card__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--ft-space-1);
	min-height: 24px;
	max-width: 100%;
	padding: 3px var(--ft-space-2);
	border: 1px solid color-mix(in srgb, var(--ft-card-accent) 30%, transparent);
	border-radius: var(--ft-radius-pill);
	background: var(--ft-card-accent-soft);
	color: var(--ft-card-accent);
	font-size: var(--ft-font-size-xs);
	font-weight: var(--ft-font-weight-semibold);
	line-height: 1.2;
	white-space: nowrap;
}

.ft-card__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: var(--ft-space-3);
	margin: 0;
}

.ft-card__fact {
	min-width: 0;
	padding: var(--ft-space-3);
	border-radius: var(--ft-radius-sm);
	background: var(--ft-card-accent-soft);
}

.ft-card__fact-label {
	display: block;
	margin-bottom: var(--ft-space-1);
	color: var(--ft-color-text-muted);
	font-size: var(--ft-font-size-xs);
	font-weight: var(--ft-font-weight-medium);
}

.ft-card__fact-value {
	display: block;
	overflow-wrap: anywhere;
	color: var(--ft-color-text-primary);
	font-size: var(--ft-font-size-body);
	font-weight: var(--ft-font-weight-semibold);
}

.ft-card__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: var(--ft-space-2);
	min-width: 0;
}

/* Semantic helpers: opt-in, never infer a real domain status. */
.ft-card--sol .ft-card__semantic-icon,
.ft-card--sol .ft-card__semantic-value { color: var(--ft-card-sol-accent); }

.ft-card--opportunity .ft-card__semantic-icon,
.ft-card--opportunity .ft-card__semantic-value { color: var(--ft-card-opportunity-accent); }

@media (max-width: 782px) {
	.ft-card__facts { grid-template-columns: 1fr 1fr; }
	.ft-card__actions { justify-content: stretch; }
	.ft-card__actions > .ft-button { flex: 1 1 auto; }
}

@media (max-width: 480px) {
	.ft-card__facts { grid-template-columns: 1fr; }
	.ft-card__badge { white-space: normal; }
}


/* =========================================================
 * FT Specialized Cards v1 — Wallet + FT Packages
 * Presentation only: balance, FT quantity, prices, benefits
 * and WooCommerce/product rules remain domain-owned values.
 * ======================================================= */
.ft-card--wallet {
	--ft-card-accent: var(--ft-card-wallet-accent);
	--ft-card-accent-soft: var(--ft-card-wallet-accent-soft);
	position: relative;
	overflow: hidden;
}

.ft-card--wallet .ft-card__balance {
	margin: 0;
	color: var(--ft-color-text-primary);
	font-size: var(--ft-font-size-value);
	font-weight: var(--ft-font-weight-bold);
	line-height: var(--ft-line-height-tight);
	letter-spacing: -0.02em;
}

.ft-card--wallet .ft-card__balance-label {
	color: var(--ft-color-text-muted);
	font-size: var(--ft-font-size-sm);
	font-weight: var(--ft-font-weight-medium);
}

.ft-card--wallet .ft-card__positive,
.ft-card--wallet .ft-card__semantic-icon {
	color: var(--ft-card-wallet-accent);
}

.ft-card--wallet .ft-card__wallet-summary {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--ft-space-3);
	padding: var(--ft-space-4);
	border-radius: var(--ft-radius-sm);
	background: var(--ft-card-wallet-accent-soft);
}

/* Packages remain neutral by default. Accent FT marks recommendation/identity. */
.ft-card--package {
	--ft-card-accent: var(--ft-card-package-accent);
	--ft-card-accent-soft: var(--ft-card-package-accent-soft);
	position: relative;
}

.ft-card--package .ft-card__ft-amount {
	margin: 0;
	color: var(--ft-color-text-primary);
	font-size: var(--ft-font-size-value);
	font-weight: var(--ft-font-weight-bold);
	line-height: var(--ft-line-height-tight);
}

.ft-card--package .ft-card__price {
	margin: 0;
	color: var(--ft-color-text-primary);
	font-size: var(--ft-font-size-section-title);
	font-weight: var(--ft-font-weight-bold);
	line-height: var(--ft-line-height-tight);
}

.ft-card--package .ft-card__benefits {
	display: grid;
	gap: var(--ft-space-2);
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--ft-color-text-secondary);
}

.ft-card--package .ft-card__benefit {
	display: flex;
	align-items: flex-start;
	gap: var(--ft-space-2);
}

.ft-card--package .ft-card__benefit::before {
	content: "✓";
	flex: 0 0 auto;
	color: var(--ft-color-success);
	font-weight: var(--ft-font-weight-bold);
}

/* Recommended is an explicit visual modifier; it never changes package data. */
.ft-card--package.ft-card--recommended {
	border-width: var(--ft-card-package-recommended-border-width);
	border-color: var(--ft-card-package-accent);
	box-shadow: var(--ft-shadow-elevated);
}

.ft-card--package .ft-card__recommended-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	max-width: 100%;
	min-height: 26px;
	padding: 4px var(--ft-space-3);
	border-radius: var(--ft-radius-pill);
	background: var(--ft-card-package-accent);
	color: var(--ft-base-black);
	font-size: var(--ft-font-size-xs);
	font-weight: var(--ft-font-weight-bold);
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.ft-card--package .ft-card__commercial-note {
	padding: var(--ft-space-3);
	border-radius: var(--ft-radius-sm);
	background: var(--ft-card-package-accent-soft);
	color: var(--ft-color-text-secondary);
	font-size: var(--ft-font-size-sm);
	line-height: var(--ft-line-height-normal);
}

@media (max-width: 782px) {
	.ft-card--wallet .ft-card__wallet-summary {
		align-items: flex-start;
		flex-direction: column;
	}
	.ft-card--package.ft-card--recommended {
		transform: none;
	}
}


/* =========================================================
 * FT Specialized Cards v1 — Dashboard + Finance + Status
 * Visual contracts only. Metrics and real domain states are
 * supplied by the owning modules.
 * ======================================================= */
.ft-card--dashboard {
	--ft-card-accent: var(--ft-card-dashboard-accent);
	--ft-card-accent-soft: var(--ft-card-dashboard-accent-soft);
}

.ft-card--dashboard .ft-card__metric {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: var(--ft-space-2);
}

.ft-card--dashboard .ft-card__metric-value {
	color: var(--ft-color-text-primary);
	font-size: var(--ft-font-size-value);
	font-weight: var(--ft-font-weight-bold);
	line-height: var(--ft-line-height-tight);
	letter-spacing: -0.02em;
}

.ft-card--dashboard .ft-card__metric-label {
	color: var(--ft-color-text-muted);
	font-size: var(--ft-font-size-sm);
	font-weight: var(--ft-font-weight-medium);
}

.ft-card--dashboard .ft-card__indicator {
	display: inline-flex;
	align-items: center;
	gap: var(--ft-space-1);
	width: fit-content;
	padding: 3px var(--ft-space-2);
	border-radius: var(--ft-radius-pill);
	background: var(--ft-card-accent-soft);
	color: var(--ft-card-accent);
	font-size: var(--ft-font-size-xs);
	font-weight: var(--ft-font-weight-semibold);
}

/* Finance stays neutral; positive/negative are explicit opt-in semantics. */
.ft-card--finance {
	--ft-card-accent: var(--ft-card-finance-accent);
	--ft-card-accent-soft: var(--ft-color-surface-subtle);
}

.ft-card--finance .ft-card__money {
	color: var(--ft-color-text-primary);
	font-size: var(--ft-font-size-value);
	font-weight: var(--ft-font-weight-bold);
	line-height: var(--ft-line-height-tight);
	font-variant-numeric: tabular-nums;
}

.ft-card--finance .ft-card__variation {
	display: inline-flex;
	align-items: center;
	gap: var(--ft-space-1);
	width: fit-content;
	font-size: var(--ft-font-size-sm);
	font-weight: var(--ft-font-weight-semibold);
}

.ft-card--finance .ft-card__variation--positive { color: var(--ft-card-finance-positive); }
.ft-card--finance .ft-card__variation--negative { color: var(--ft-card-finance-negative); }
.ft-card--finance .ft-card__variation--neutral { color: var(--ft-color-text-muted); }

.ft-card--finance .ft-card__breakdown {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: var(--ft-space-3);
}

.ft-card--finance .ft-card__breakdown-item {
	padding: var(--ft-space-3);
	border: 1px solid var(--ft-color-border);
	border-radius: var(--ft-radius-sm);
	background: var(--ft-color-surface-subtle);
}

/* Status card: color is never the only signal; pair with visible text/icon. */
.ft-card--status {
	--ft-card-accent: var(--ft-card-status-neutral);
	--ft-card-accent-soft: var(--ft-color-surface-subtle);
}

.ft-card--status.ft-card--status-info {
	--ft-card-accent: var(--ft-color-info);
	--ft-card-accent-soft: var(--ft-color-info-soft);
}
.ft-card--status.ft-card--status-success {
	--ft-card-accent: var(--ft-color-success);
	--ft-card-accent-soft: var(--ft-color-success-soft);
}
.ft-card--status.ft-card--status-warning {
	--ft-card-accent: var(--ft-color-warning);
	--ft-card-accent-soft: var(--ft-color-warning-soft);
}
.ft-card--status.ft-card--status-danger {
	--ft-card-accent: var(--ft-color-danger);
	--ft-card-accent-soft: var(--ft-color-danger-soft);
}
.ft-card--status.ft-card--status-intelligence {
	--ft-card-accent: var(--ft-color-intelligence);
	--ft-card-accent-soft: var(--ft-color-intelligence-soft);
}
.ft-card--status.ft-card--status-ft {
	--ft-card-accent: var(--ft-color-accent);
	--ft-card-accent-soft: var(--ft-color-accent-soft);
}

.ft-card--status {
	border-left: 4px solid var(--ft-card-accent);
}

.ft-card--status .ft-card__status-heading {
	display: flex;
	align-items: center;
	gap: var(--ft-space-2);
	color: var(--ft-card-accent);
	font-size: var(--ft-font-size-card-title);
	font-weight: var(--ft-font-weight-semibold);
}

.ft-card--status .ft-card__status-summary {
	padding: var(--ft-space-3);
	border-radius: var(--ft-radius-sm);
	background: var(--ft-card-accent-soft);
	color: var(--ft-color-text-primary);
}

@media (max-width: 782px) {
	.ft-card--finance .ft-card__breakdown {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 480px) {
	.ft-card--finance .ft-card__breakdown {
		grid-template-columns: 1fr;
	}
}


/* FT Theme Engine — personalization lifecycle states */
.ft-theme-lifecycle {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--ft-space-2);
}
.ft-theme-lifecycle__state {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 4px var(--ft-space-3);
	border: 1px solid var(--ft-color-border);
	border-radius: var(--ft-radius-pill);
	background: var(--ft-color-surface-subtle);
	color: var(--ft-color-text-secondary);
	font-size: var(--ft-font-size-xs);
	font-weight: var(--ft-font-weight-semibold);
}
.ft-theme-lifecycle__state[data-state="DRAFT"] {
	border-color: var(--ft-color-success);
	background: var(--ft-color-success-soft);
	color: var(--ft-color-success);
}
.ft-theme-lifecycle__state[data-state="PUBLISHED"] {
	border-color: var(--ft-color-success);
	background: var(--ft-color-success-soft);
	color: var(--ft-color-success);
}


/* FT Theme Engine — Appearance editor */
.ft-theme-personalization { max-width: 1000px; margin: 0 0 var(--ft-space-5); }
.ft-theme-flow { display:flex; align-items:center; flex-wrap:wrap; gap:var(--ft-space-2); padding:var(--ft-space-3); border-radius:var(--ft-radius-sm); background:var(--ft-color-surface-subtle); color:var(--ft-color-text-secondary); font-size:var(--ft-font-size-xs); font-weight:var(--ft-font-weight-semibold); }
.ft-theme-flow span:not(:last-child)::after { content:"→"; margin-left:var(--ft-space-2); color:var(--ft-color-text-muted); }
.ft-theme-editor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--ft-space-3); margin:var(--ft-space-4) 0; }
.ft-theme-color-field { display:flex; align-items:center; justify-content:space-between; gap:var(--ft-space-3); min-height:52px; padding:var(--ft-space-3); border:1px solid var(--ft-color-border); border-radius:var(--ft-radius-sm); background:var(--ft-color-surface); font-weight:var(--ft-font-weight-semibold); }
.ft-theme-color-control { display:flex; align-items:center; gap:var(--ft-space-2); }
.ft-theme-color-control input[type="color"] { width:42px; height:32px; padding:2px; border:1px solid var(--ft-color-border); border-radius:var(--ft-radius-sm); background:var(--ft-color-surface); cursor:pointer; }
.ft-theme-color-control code { min-width:72px; color:var(--ft-color-text-secondary); text-align:right; }
.ft-theme-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:var(--ft-space-2); margin-top:var(--ft-space-4); }
.ft-theme-info { padding:var(--ft-space-3); border-radius:var(--ft-radius-sm); background:var(--ft-color-info-soft); color:var(--ft-color-text-primary); }
@media (max-width:782px){ .ft-theme-editor-grid{grid-template-columns:1fr;} .ft-theme-actions{justify-content:stretch;} .ft-theme-actions>.ft-button{flex:1 1 auto;} }


/* FT Theme Engine — isolated responsive preview */
.ft-theme-preview-shell{max-width:1000px;margin:0 0 var(--ft-space-5);}
.ft-theme-preview-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--ft-space-3);}
.ft-theme-preview-group{display:flex;align-items:center;flex-wrap:wrap;gap:var(--ft-space-2);}
.ft-theme-preview-group .ft-button.is-active{background:var(--ft-color-primary);border-color:var(--ft-color-primary);color:var(--ft-color-on-primary);font-weight:600;}
.ft-theme-preview-stage{overflow:auto;padding:var(--ft-space-4);border:1px solid var(--ft-color-border);border-radius:var(--ft-radius-md);background:var(--ft-color-surface-subtle);}
.ft-theme-preview-viewport{width:100%;max-width:100%;margin:0 auto;overflow:hidden;border:1px solid var(--ft-color-border);border-radius:var(--ft-radius-md);background:var(--ft-color-background);color:var(--ft-color-text-primary);box-shadow:var(--ft-shadow-card);transition:max-width var(--ft-motion-default) var(--ft-ease-standard);}
.ft-theme-preview-shell[data-ft-preview-device="tablet"] .ft-theme-preview-viewport{max-width:768px;}
.ft-theme-preview-shell[data-ft-preview-device="mobile"] .ft-theme-preview-viewport{max-width:390px;}
.ft-theme-preview-demo{min-height:420px;background:var(--ft-color-background);}
.ft-theme-preview-topbar{display:flex;align-items:center;justify-content:space-between;gap:var(--ft-space-3);padding:var(--ft-space-4);background:var(--ft-color-primary);color:var(--ft-color-on-primary);}
.ft-theme-preview-content{display:grid;grid-template-columns:160px minmax(0,1fr);min-height:360px;}
.ft-theme-preview-sidebar{display:flex;flex-direction:column;gap:var(--ft-space-3);padding:var(--ft-space-4);border-right:1px solid var(--ft-color-border);background:var(--ft-color-surface);color:var(--ft-color-text-secondary);}
.ft-theme-preview-main{padding:var(--ft-space-5);min-width:0;}
.ft-theme-preview-main h3{margin:0 0 var(--ft-space-2);color:var(--ft-color-text-primary);}
.ft-theme-preview-main p{color:var(--ft-color-text-secondary);}
.ft-theme-preview-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ft-space-3);margin:var(--ft-space-4) 0;}
.ft-theme-preview-actions{display:flex;align-items:center;flex-wrap:wrap;gap:var(--ft-space-2);}
.ft-theme-preview-shell[data-ft-preview-device="mobile"] .ft-theme-preview-content{grid-template-columns:1fr;}
.ft-theme-preview-shell[data-ft-preview-device="mobile"] .ft-theme-preview-sidebar{display:none;}
.ft-theme-preview-shell[data-ft-preview-device="mobile"] .ft-theme-preview-cards{grid-template-columns:1fr;}
.ft-theme-preview-shell[data-ft-preview-device="mobile"] .ft-theme-preview-main{padding:var(--ft-space-4);}

/* FT Theme Engine — publication history / safe rollback */
.ft-theme-history{margin-top:var(--ft-space-5);padding-top:var(--ft-space-4);border-top:1px solid var(--ft-color-border);}
.ft-theme-history__heading{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--ft-space-3);margin-bottom:var(--ft-space-3);}
.ft-theme-history__heading h3{margin:0 0 var(--ft-space-1);}
.ft-theme-history__heading p{margin:0;color:var(--ft-color-text-secondary);}
.ft-theme-history__list{display:grid;gap:var(--ft-space-2);}
.ft-theme-history__item{display:flex;align-items:center;justify-content:space-between;gap:var(--ft-space-3);padding:var(--ft-space-3);border:1px solid var(--ft-color-border);border-radius:var(--ft-radius-sm);background:var(--ft-color-surface);}
.ft-theme-history__item p{margin:var(--ft-space-1) 0 0;color:var(--ft-color-text-muted);font-size:var(--ft-font-size-xs);}
@media(max-width:600px){.ft-theme-history__item{align-items:flex-start;flex-direction:column;}.ft-theme-history__item .ft-button{width:100%;}}

/* FT Theme Engine — accessibility pre-check */
.ft-theme-precheck{margin-top:var(--ft-space-4);padding:var(--ft-space-3);border:1px solid var(--ft-color-border);border-radius:var(--ft-radius-md);background:var(--ft-color-surface-subtle);}
.ft-theme-precheck__heading{display:flex;align-items:center;justify-content:space-between;gap:var(--ft-space-3);margin-bottom:var(--ft-space-3);}
.ft-theme-precheck__heading>div{display:flex;flex-direction:column;gap:var(--ft-space-1);}
.ft-theme-precheck__heading span:not(.ft-status){color:var(--ft-color-text-secondary);font-size:var(--ft-font-size-sm);}
.ft-theme-precheck__checks{display:grid;gap:var(--ft-space-2);}
.ft-theme-precheck__item{display:flex;align-items:center;justify-content:space-between;gap:var(--ft-space-3);padding:var(--ft-space-2) var(--ft-space-3);border-radius:var(--ft-radius-sm);background:var(--ft-color-surface);}
.ft-theme-precheck__item>span:last-child{display:flex;align-items:center;gap:var(--ft-space-2);white-space:nowrap;}
.ft-theme-precheck__item em{color:var(--ft-color-text-muted);font-size:var(--ft-font-size-xs);font-style:normal;}
@media(max-width:600px){.ft-theme-precheck__item{align-items:flex-start;flex-direction:column;}.ft-theme-precheck__item>span:last-child{white-space:normal;flex-wrap:wrap;}}

/* FT Theme Preview — deterministic device viewport v2 (.410) */
.ft-theme-preview-shell.ft-preview-device--desktop .ft-theme-preview-viewport{width:100%;max-width:100%;}
.ft-theme-preview-shell.ft-preview-device--tablet .ft-theme-preview-viewport{width:768px;max-width:768px;}
.ft-theme-preview-shell.ft-preview-device--mobile .ft-theme-preview-viewport{width:390px;max-width:390px;}

/* v0.230.6.5.7.412 — Preview device selector sem dependencia de JavaScript. */
.ft-theme-preview-device-input{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;}
.ft-theme-preview-device-label{cursor:pointer;user-select:none;}
#ft-theme-preview-device-desktop:checked ~ .ft-theme-preview-toolbar [data-ft-preview-device-label="desktop"],
#ft-theme-preview-device-tablet:checked ~ .ft-theme-preview-toolbar [data-ft-preview-device-label="tablet"],
#ft-theme-preview-device-mobile:checked ~ .ft-theme-preview-toolbar [data-ft-preview-device-label="mobile"]{background:var(--ft-color-primary);border-color:var(--ft-color-primary);color:var(--ft-color-on-primary);font-weight:600;}
#ft-theme-preview-device-desktop:focus-visible ~ .ft-theme-preview-toolbar [data-ft-preview-device-label="desktop"],
#ft-theme-preview-device-tablet:focus-visible ~ .ft-theme-preview-toolbar [data-ft-preview-device-label="tablet"],
#ft-theme-preview-device-mobile:focus-visible ~ .ft-theme-preview-toolbar [data-ft-preview-device-label="mobile"]{outline:2px solid var(--ft-color-accent);outline-offset:2px;}
#ft-theme-preview-device-desktop:checked ~ .ft-theme-preview-stage .ft-theme-preview-viewport{width:100%;max-width:100%;}
#ft-theme-preview-device-tablet:checked ~ .ft-theme-preview-stage .ft-theme-preview-viewport{width:768px;max-width:768px;}
#ft-theme-preview-device-mobile:checked ~ .ft-theme-preview-stage .ft-theme-preview-viewport{width:390px;max-width:390px;}
#ft-theme-preview-device-mobile:checked ~ .ft-theme-preview-stage .ft-theme-preview-content{grid-template-columns:1fr;}
#ft-theme-preview-device-mobile:checked ~ .ft-theme-preview-stage .ft-theme-preview-sidebar{display:none;}
#ft-theme-preview-device-mobile:checked ~ .ft-theme-preview-stage .ft-theme-preview-cards{grid-template-columns:1fr;}
#ft-theme-preview-device-mobile:checked ~ .ft-theme-preview-stage .ft-theme-preview-main{padding:var(--ft-space-4);}


/* v0.230.6.5.7.412 — Preview surface selector nativo e superfícies independentes. */
.ft-theme-preview-area-input{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;}
.ft-theme-preview-area-label{cursor:pointer;user-select:none;}
#ft-theme-preview-area-admin:checked ~ .ft-theme-preview-toolbar [data-ft-preview-area-label-button="admin"],
#ft-theme-preview-area-professional:checked ~ .ft-theme-preview-toolbar [data-ft-preview-area-label-button="professional"],
#ft-theme-preview-area-client:checked ~ .ft-theme-preview-toolbar [data-ft-preview-area-label-button="client"]{background:var(--ft-color-primary);border-color:var(--ft-color-primary);color:var(--ft-color-on-primary);font-weight:600;}
#ft-theme-preview-area-admin:focus-visible ~ .ft-theme-preview-toolbar [data-ft-preview-area-label-button="admin"],
#ft-theme-preview-area-professional:focus-visible ~ .ft-theme-preview-toolbar [data-ft-preview-area-label-button="professional"],
#ft-theme-preview-area-client:focus-visible ~ .ft-theme-preview-toolbar [data-ft-preview-area-label-button="client"]{outline:2px solid var(--ft-color-accent);outline-offset:2px;}
.ft-theme-preview-surface{display:none;}
#ft-theme-preview-area-admin:checked ~ .ft-theme-preview-stage .ft-theme-preview-surface--admin,
#ft-theme-preview-area-professional:checked ~ .ft-theme-preview-stage .ft-theme-preview-surface--professional,
#ft-theme-preview-area-client:checked ~ .ft-theme-preview-stage .ft-theme-preview-surface--client{display:block;}
