/* Emblem Studio — front-end styles
   Everything is prefixed with .emst- and scoped to the studio shell, so theme CSS stays out. */

:root {
	--emst-accent: #ed2024;
	--emst-accent-ink: #ffffff;
	--emst-bg: #edeef2;
	--emst-bg-2: #e4e6ec;
	--emst-panel: #ffffff;
	--emst-ink: #12151a;
	--emst-muted: #6b7280;
	--emst-line: #e6e8ec;
	--emst-soft: #f4f5f7;
	--emst-good: #12a150;
	--emst-warn: #d97706;
	--emst-poor: #dc2626;
	--emst-trim: #12151a;
	--emst-safe: #12b981;
	--emst-bleed: rgba(226, 61, 90, 0.14);
	--emst-radius: 10px;
	--emst-font: inherit;
}

/* ------------------------------------------------------------------ */
/* Product page launcher                                               */
/* ------------------------------------------------------------------ */

.emst-launch-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin: 12px 0 4px;
}
.emst-launch {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border: 1.5px solid var(--emst-accent);
	border-radius: 8px;
	background: transparent;
	color: var(--emst-accent);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 130ms ease, color 130ms ease, box-shadow 130ms ease;
}
.emst-launch:hover { background: var(--emst-accent); color: var(--emst-accent-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--emst-accent) 30%, transparent); }
.emst-launch:focus-visible { outline: 3px solid color-mix(in srgb, var(--emst-accent) 40%, white); outline-offset: 2px; }
.emst-launch:disabled, .emst-launch.is-loading { opacity: 0.6; cursor: progress; }
.emst-launch.is-blocked { cursor: not-allowed; border-color: var(--emst-line); color: var(--emst-muted); background: transparent; }
.emst-launch.is-blocked:hover { background: transparent; color: var(--emst-muted); box-shadow: none; }
.emst-launch__need { display: inline-flex; align-items: center; gap: 6px; color: #92400e; background: #fef3c7; border-radius: 8px; padding: 6px 10px; font-size: 0.9em; }
.emst-launch__icon { display: inline-flex; }
.emst-launch__hint { color: var(--emst-muted); font-size: 0.9em; }
.emst-resume {
	flex-basis: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 8px;
	background: var(--emst-soft);
	font-size: 0.92em;
}
.emst-resume__btn {
	appearance: none;
	border: 0;
	background: var(--emst-accent);
	color: var(--emst-accent-ink);
	border-radius: 6px;
	padding: 6px 12px;
	font: inherit;
	font-size: 0.92em;
	font-weight: 600;
	cursor: pointer;
}
.emst-resume__btn--quiet { background: transparent; color: var(--emst-ink); text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Shell                                                               */
/* ------------------------------------------------------------------ */

html.emst-open, html.emst-open body { overflow: hidden !important; }

.emst-root { position: fixed; inset: 0; z-index: 100000; }
.emst-root[hidden] { display: none !important; }

.emst-shell {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-rows: 56px 1fr;
	background: var(--emst-bg);
	color: var(--emst-ink);
	font-family: var(--emst-font);
	font-size: 14px;
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}
.emst-shell *, .emst-shell *::before, .emst-shell *::after { box-sizing: border-box; }
.emst-shell svg:not(.emst-artboard-svg):not(.emst-guides) { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.emst-shell h2, .emst-shell h3, .emst-shell h4 { margin: 0; font-family: inherit; color: inherit; }
.emst-shell p { margin: 0; }
.emst-shell button { font-family: inherit; }

/* Buttons */
.emst-btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 38px;
	padding: 0 16px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: var(--emst-soft);
	color: var(--emst-ink);
	font: inherit;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}
.emst-btn:hover { background: #e9ebef; }
.emst-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.emst-btn:focus-visible { outline: 2px solid var(--emst-accent); outline-offset: 2px; }
.emst-btn--primary { background: var(--emst-accent); color: var(--emst-accent-ink); }
.emst-btn--primary:hover { background: color-mix(in srgb, var(--emst-accent) 88%, black); }
.emst-btn--ghost { background: transparent; border-color: var(--emst-line); }
.emst-btn--ghost:hover { background: var(--emst-soft); }
.emst-btn--ghost.is-active { border-color: var(--emst-accent); color: var(--emst-accent); }
.emst-btn--icon { width: 36px; min-height: 36px; padding: 0; background: transparent; border-radius: 8px; }
.emst-btn--icon:hover { background: rgba(0, 0, 0, 0.06); }
.emst-btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.emst-btn--block { width: 100%; }
.emst-linkbtn { appearance: none; border: 0; background: none; padding: 0; color: var(--emst-accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Top bar */
.emst-topbar {
	display: grid;
	grid-template-columns: auto auto 1fr auto auto;
	align-items: center;
	gap: 12px;
	padding: 0 12px;
	background: var(--emst-panel);
	border-bottom: 1px solid var(--emst-line);
}
.emst-topbar__back { color: var(--emst-ink); }
.emst-brand { display: flex; align-items: center; gap: 9px; padding-right: 14px; margin-right: 2px; border-right: 1px solid var(--emst-line); min-width: 0; }
.emst-brand__logo { max-height: 30px; max-width: 150px; width: auto; height: auto; display: block; }
.emst-brand__name { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.emst-brand__beta { padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--emst-accent) 12%, white); color: var(--emst-accent); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.emst-beta { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--emst-accent) 12%, white); color: var(--emst-accent); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.emst-topbar__title { display: flex; flex-direction: column; min-width: 0; }
.emst-topbar__title strong { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emst-topbar__meta { color: var(--emst-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emst-topbar__status { color: var(--emst-muted); font-size: 12px; white-space: nowrap; }
.emst-topbar__status[data-state="saved"], .emst-topbar__status[data-state="local"] { color: var(--emst-good); }
.emst-topbar__status[data-state="error"] { color: var(--emst-poor); }
.emst-topbar__actions { display: flex; align-items: center; gap: 6px; }
.emst-topbar__actions .emst-btn--icon { color: var(--emst-ink); }
.emst-topbar__preview { display: inline-flex; }

/* Body */
.emst-body {
	display: grid;
	grid-template-columns: 88px auto minmax(0, 1fr) auto;
	min-height: 0;
}
.emst-panel { width: 320px; }
.emst-shell.has-wide-panel .emst-panel { width: 420px; }
.emst-shell:not(.has-panel) .emst-panel { display: none; }
.emst-side { width: 300px; }
.emst-shell.no-side .emst-side { display: none; }
.emst-scale { display: inline-flex; align-items: center; gap: 0; margin-right: 4px; padding: 0 2px; border: 1px solid var(--emst-line); border-radius: 999px; }
.emst-scale span { min-width: 40px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--emst-muted); font-variant-numeric: tabular-nums; }
.emst-scale .emst-btn--icon { width: 28px; min-height: 28px; }
.emst-shell .emst-scale .emst-btn--icon { min-height: 28px !important; }
.emst-side__tools { display: inline-flex; align-items: center; gap: 4px; }

/* Rail */
.emst-rail {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px 10px;
	background: var(--emst-panel);
	border-right: 1px solid var(--emst-line);
	overflow-y: auto;
}
.emst-rail__btn {
	appearance: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 64px;
	padding: 10px 4px 9px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--emst-muted);
	font: inherit;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: 0;
	cursor: pointer;
}
.emst-rail__btn span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emst-rail__btn svg { width: 24px; height: 24px; stroke-width: 1.8; }
.emst-rail__btn:hover { background: var(--emst-soft); color: var(--emst-ink); }
.emst-rail__btn.is-active { background: color-mix(in srgb, var(--emst-accent) 12%, white); color: var(--emst-accent); }
.emst-rail__btn--mobile { display: none; }

/* Panel */
.emst-panel {
	overflow-y: auto;
	padding: 18px 18px 40px;
	background: var(--emst-panel);
	border-right: 1px solid var(--emst-line);
}
.emst-panel__title { font-size: 17px; font-weight: 700; margin-bottom: 12px !important; }
.emst-panel__sub { font-size: 12px; font-weight: 700; color: var(--emst-muted); margin: 22px 0 10px !important; }
.emst-panel__hint { color: var(--emst-muted); font-size: 12.5px; margin: 10px 0 !important; }
.emst-ok { display: flex; align-items: center; gap: 8px; color: var(--emst-good); font-weight: 600; }

.emst-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 0; margin: 12px 0 0; }
.emst-field__label { font-size: 12px; font-weight: 600; color: var(--emst-muted); }
.emst-field__hint { font-size: 11px; color: var(--emst-muted); }
.emst-row { display: flex; gap: 10px; align-items: flex-start; }
.emst-row > .emst-field { margin-top: 12px; }
.emst-row--tight { align-items: center; margin: 10px 0; }
.emst-row--wrap { flex-wrap: wrap; }
.emst-input {
	width: 100%;
	min-height: 36px;
	padding: 6px 10px;
	border: 1px solid var(--emst-line);
	border-radius: 8px;
	background: #fff;
	color: var(--emst-ink);
	font: inherit;
	font-size: 14px;
	line-height: 1.3;
}
.emst-input:focus { outline: 2px solid var(--emst-accent); outline-offset: -1px; border-color: transparent; }
.emst-input--text { resize: vertical; min-height: 72px; }
.emst-input--num { padding: 6px 8px; }
.emst-range { width: 100%; accent-color: var(--emst-accent); margin: 4px 0 8px; }
.emst-details { margin-top: 10px; border-top: 1px solid var(--emst-line); padding-top: 8px; }
.emst-details summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--emst-muted); padding: 6px 0; }

.emst-segment { display: inline-flex; border: 1px solid var(--emst-line); border-radius: 8px; overflow: hidden; }
.emst-segment__btn {
	appearance: none;
	border: 0;
	background: #fff;
	color: var(--emst-ink);
	min-height: 34px;
	padding: 0 12px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.emst-segment__btn + .emst-segment__btn { border-left: 1px solid var(--emst-line); }
.emst-segment__btn.is-active { background: color-mix(in srgb, var(--emst-accent) 12%, white); color: var(--emst-accent); }

.emst-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.emst-swatches--lg { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px 8px; justify-items: center; }
.emst-swatches--lg .emst-swatch { width: 38px; height: 38px; }
.emst-swatch {
	appearance: none;
	position: relative;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.14);
	cursor: pointer;
	padding: 0;
	box-shadow: inset 0 0 0 2px #fff;
}
.emst-swatch.is-active { outline: 2px solid var(--emst-accent); outline-offset: 2px; }
.emst-swatch--none { background: conic-gradient(#e5e7eb 25%, #fff 0 50%, #e5e7eb 0 75%, #fff 0) 0 0/10px 10px; }
.emst-swatch--none::after { content: ""; position: absolute; left: 50%; top: 10%; width: 2px; height: 80%; background: var(--emst-poor); transform: rotate(45deg) translateX(-50%); }
.emst-swatch--custom { background: conic-gradient(from 90deg, #f43f5e, #f59e0b, #22c55e, #3b82f6, #a855f7, #f43f5e); overflow: hidden; }
.emst-swatch--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.emst-inspector { margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--emst-line); }
.emst-inspector > .emst-field:first-child { margin-top: 10px; }
.emst-range { margin: 10px 0 4px; }
.emst-inspector__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.emst-inspector__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emst-inspector__note { color: var(--emst-muted); font-size: 12.5px; margin: 6px 0 10px !important; }

/* Quality */
.emst-quality { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.emst-quality svg { width: 14px; height: 14px; }
.emst-quality--good, .emst-quality--vector { background: color-mix(in srgb, var(--emst-good) 14%, white); color: var(--emst-good); }
.emst-quality--ok { background: color-mix(in srgb, var(--emst-good) 10%, white); color: #15803d; }
.emst-quality--warn, .emst-quality--unknown { background: color-mix(in srgb, var(--emst-warn) 16%, white); color: var(--emst-warn); }
.emst-quality--poor { background: color-mix(in srgb, var(--emst-poor) 12%, white); color: var(--emst-poor); }
.emst-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.emst-dot--good, .emst-dot--vector { background: var(--emst-good); }
.emst-dot--ok { background: #4ade80; }
.emst-dot--warn, .emst-dot--unknown { background: var(--emst-warn); }
.emst-dot--poor { background: var(--emst-poor); }
.emst-issues { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.emst-issue { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.35; }
.emst-issue svg { width: 15px; height: 15px; margin-top: 1px; }
.emst-issue--block { background: color-mix(in srgb, var(--emst-poor) 10%, white); color: var(--emst-poor); }
.emst-issue--warn { background: color-mix(in srgb, var(--emst-warn) 12%, white); color: #92400e; }

/* Upload */
.emst-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 22px 14px;
	border: 1.5px dashed var(--emst-line);
	border-radius: var(--emst-radius);
	text-align: center;
	cursor: pointer;
	color: var(--emst-muted);
	font-size: 12.5px;
	transition: border-color 120ms ease, background 120ms ease;
}
.emst-drop strong { color: var(--emst-ink); font-size: 14px; }
.emst-drop svg { width: 24px; height: 24px; color: var(--emst-accent); }
.emst-drop:hover, .emst-drop.is-over { border-color: var(--emst-accent); background: color-mix(in srgb, var(--emst-accent) 6%, white); }
.emst-uploads { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.emst-upload { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.emst-upload__bar { height: 4px; border-radius: 4px; background: var(--emst-soft); overflow: hidden; }
.emst-upload__bar i { display: block; height: 100%; background: var(--emst-accent); transition: width 150ms ease; }
.emst-upload__err { color: var(--emst-poor); }
.emst-assets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.emst-assets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; }
.emst-asset { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.emst-asset__main { appearance: none; display: block; width: 100%; padding: 0; border: 1px solid var(--emst-line); border-radius: 10px; background: #fff; cursor: pointer; overflow: hidden; }
.emst-asset__main:hover { border-color: var(--emst-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--emst-accent) 18%, white); }
.emst-asset__img { display: block; position: relative; width: 100%; padding-top: 100%; background: conic-gradient(#eceef1 25%, #fff 0 50%, #eceef1 0 75%, #fff 0) 0 0/12px 12px; }
.emst-asset__img img, .emst-asset__ph { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; display: flex; align-items: center; justify-content: center; color: var(--emst-muted); }
.emst-asset__name { font-size: 11px; color: var(--emst-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.emst-asset__used { position: absolute; top: 6px; left: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--emst-good); box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.emst-asset__del { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; padding: 0; border-radius: 6px; border: 0; background: rgba(255, 255, 255, 0.92); color: var(--emst-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18); opacity: 0; transition: opacity 120ms ease; }
.emst-asset:hover .emst-asset__del, .emst-asset__del:focus-visible { opacity: 1; }
.emst-asset__del svg { width: 13px; height: 13px; }
.emst-asset__del:hover { color: var(--emst-poor); }

/* Layers */
.emst-layerlist { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 4px; }
.emst-layer-row { display: flex; align-items: center; border-radius: 8px; border: 1px solid transparent; }
.emst-layer-row.is-active { background: color-mix(in srgb, var(--emst-accent) 8%, white); border-color: color-mix(in srgb, var(--emst-accent) 35%, white); }
.emst-layer-row.is-hidden .emst-layer-row__name { opacity: 0.5; text-decoration: line-through; }
.emst-layer-row__main { appearance: none; flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.emst-layer-row__icon { color: var(--emst-muted); display: inline-flex; }
.emst-layer-row__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emst-layer-row__tools { display: none; gap: 0; }
.emst-layer-row:hover .emst-layer-row__tools, .emst-layer-row.is-active .emst-layer-row__tools { display: inline-flex; }
.emst-layer-row__tools .emst-btn--icon { width: 28px; min-height: 28px; }
.emst-layer-row__tools svg { width: 15px; height: 15px; }

/* Notes */
.emst-panel__note { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 !important; padding: 9px 11px; border-radius: 8px; background: var(--emst-soft); color: var(--emst-muted); font-size: 12px; line-height: 1.4; }
.emst-panel__note svg { width: 14px; height: 14px; margin-top: 1px; color: var(--emst-warn); }
.emst-qr { display: flex; gap: 8px; margin: 6px 0 8px; }
.emst-qr .emst-input { flex: 1; }
.emst-align { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 10px 0 2px; padding-top: 10px; border-top: 1px solid var(--emst-line); }
.emst-align .emst-btn--icon { width: 32px; min-height: 32px; }
.emst-align .emst-btn--sm { margin-left: auto; }
.emst-fill { margin: 0 0 14px; padding: 12px; border-radius: var(--emst-radius); background: color-mix(in srgb, var(--emst-accent) 6%, white); border: 1px solid color-mix(in srgb, var(--emst-accent) 25%, white); }
.emst-fill .emst-panel__sub { margin-top: 0 !important; color: var(--emst-ink); }
.emst-fill .emst-field__label em { font-style: normal; color: var(--emst-muted); font-weight: 400; }

/* Shapes */
.emst-shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.emst-shape-btn {
	appearance: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 72px;
	padding: 12px 4px 10px;
	border: 1px solid var(--emst-line);
	border-radius: 8px;
	background: #fff;
	color: var(--emst-ink);
	font: inherit;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
}
.emst-shape-btn:hover { border-color: var(--emst-accent); color: var(--emst-accent); }
.emst-shape-btn svg { width: 26px; height: 26px; stroke-width: 1.6; }
.emst-colorpick { position: relative; display: inline-flex; align-items: center; min-height: 36px; }
.emst-colorpick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.emst-colorpick i { display: block; width: 36px; height: 30px; border-radius: 6px; border: 1px solid var(--emst-line); box-shadow: inset 0 0 0 2px #fff; }
.emst-check--sm { font-size: 13px; margin: 10px 0 6px; }

/* Image adjustments */
.emst-fx { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; }
.emst-fx > span { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--emst-muted); }
.emst-fx b { font-weight: 600; color: var(--emst-ink); font-variant-numeric: tabular-nums; }
.emst-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.emst-preset { appearance: none; padding: 6px 10px; border: 1px solid var(--emst-line); border-radius: 999px; background: #fff; color: var(--emst-ink); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.emst-preset:hover { border-color: var(--emst-accent); color: var(--emst-accent); }

/* Gradients */
.emst-gradients { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin: 10px 0; }
.emst-gradient { appearance: none; aspect-ratio: 1; min-height: 28px; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 8px; cursor: pointer; padding: 0; }
.emst-gradient.is-active { outline: 2px solid var(--emst-accent); outline-offset: 2px; }

/* Image library */
.emst-tabs { display: flex; gap: 2px; margin: 0 0 12px; border-bottom: 1px solid var(--emst-line); }
.emst-tab { appearance: none; padding: 9px 12px 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--emst-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.emst-tab:hover { color: var(--emst-ink); }
.emst-tab.is-active { color: var(--emst-accent); border-bottom-color: var(--emst-accent); }
.emst-search { position: relative; display: flex; align-items: center; margin-bottom: 10px; }
.emst-shell .emst-search .emst-input { padding: 6px 36px 6px 38px !important; border-radius: 999px !important; min-height: 42px !important; background: var(--emst-soft) !important; border-color: transparent !important; }
.emst-shell .emst-search .emst-input:focus { background: #fff !important; }
.emst-search__icon { position: absolute; left: 13px; display: inline-flex; color: var(--emst-muted); pointer-events: none; }
.emst-search__clear { position: absolute; right: 8px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--emst-muted); cursor: pointer; }
.emst-search__clear:hover { background: rgba(0, 0, 0, 0.06); color: var(--emst-ink); }
.emst-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.emst-chips::-webkit-scrollbar { display: none; }
.emst-chip { appearance: none; flex: none; padding: 6px 12px; border: 1px solid var(--emst-line); border-radius: 999px; background: #fff; color: var(--emst-ink); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.emst-chip:hover, .emst-chip.is-active { border-color: var(--emst-accent); color: var(--emst-accent); background: color-mix(in srgb, var(--emst-accent) 6%, white); }
.emst-stock__quality { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px !important; font-size: 12px; color: var(--emst-muted); }
.emst-stock__quality > svg { width: 14px; height: 14px; color: var(--emst-good); flex: none; }
.emst-stock__quality > svg + span { flex: 1 1 200px; }
.emst-masonry { columns: 2; column-gap: 10px; }
.emst-tile { display: block; width: 100%; break-inside: avoid; margin: 0 0 10px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--emst-soft); cursor: pointer; position: relative; text-align: left; line-height: 0; }
/* Each tile keeps the image's own shape — width/height attributes give the intrinsic ratio. */
.emst-tile img { display: block; width: 100%; height: auto; transition: transform 200ms ease; }
.emst-tile.is-vector { background: #fff; border: 1px solid var(--emst-line); padding: 6% !important; box-sizing: border-box; }
.emst-tile.is-vector img { max-height: 180px; object-fit: contain; }
.emst-tile:hover img { transform: scale(1.04); }
.emst-tile::after { content: ""; position: absolute; inset: 0; background: rgba(15, 23, 42, 0); transition: background 150ms ease; pointer-events: none; }
.emst-tile:hover::after, .emst-tile:focus-visible::after { background: rgba(15, 23, 42, 0.18); }
.emst-tile__add { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.92); display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border-radius: 999px; background: #fff; color: var(--emst-ink); font-size: 12.5px; font-weight: 700; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25); opacity: 0; transition: opacity 150ms ease, transform 150ms ease; pointer-events: none; }
.emst-tile:hover .emst-tile__add, .emst-tile:focus-visible .emst-tile__add { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.emst-tile__add svg { width: 14px; height: 14px; }
.emst-tile__badge { position: absolute; left: 8px; top: 8px; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: var(--emst-muted); font-size: 10.5px; font-weight: 700; }
.emst-panel__credit { margin: 14px 0 0 !important; font-size: 11px; color: var(--emst-muted); }
.emst-panel__credit a { color: inherit; }

/* Full-screen panel (image browsing) */
.emst-shell.panel-full .emst-panel {
	position: absolute;
	inset: 0;
	width: auto !important;
	z-index: 8;
	border-right: 0;
	padding: 22px 28px 32px;
}
.emst-shell.panel-full .emst-masonry { columns: 5; column-gap: 14px; }
.emst-shell.panel-full .emst-panel__title { position: sticky; top: -22px; background: var(--emst-panel); padding-top: 4px; z-index: 2; }
.emst-shell.panel-full .emst-chips { flex-wrap: wrap; overflow: visible; }
.emst-panel__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.emst-panel__expand { flex: none; color: var(--emst-muted); }
.emst-shell .emst-panel__expand { color: var(--emst-muted) !important; }
.emst-shell .emst-panel__expand:hover { color: var(--emst-ink) !important; }

/* Templates */
.emst-templates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.emst-template {
	appearance: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px;
	border: 1px solid var(--emst-line);
	border-radius: var(--emst-radius);
	background: #fff;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.emst-template:hover { border-color: var(--emst-accent); box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08); }
.emst-template__thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--emst-soft); overflow: hidden; color: var(--emst-muted); }
.emst-template__thumb img { width: 100%; height: 100%; object-fit: contain; }
.emst-template__name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emst-topbar__template span { margin-left: 2px; }

/* Specs */
.emst-specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 !important; font-size: 13px; }
.emst-specs dt { color: var(--emst-muted); }
.emst-specs dd { margin: 0; font-weight: 600; }

/* Ideas */
.emst-ideas { list-style: none; margin: 14px 0 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.emst-ideas li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--emst-line); border-radius: 8px; }
.emst-ideas__tools { display: inline-flex; gap: 4px; flex: none; }

/* Workspace */
.emst-workspace { position: relative; min-width: 0; min-height: 0; background: var(--emst-bg); }
.emst-ruler { position: absolute; z-index: 2; pointer-events: none; background: var(--emst-panel); }
.emst-ruler--h { left: 22px; top: 0; }
.emst-ruler--v { left: 0; top: 22px; }
.emst-stage {
	position: absolute;
	inset: 22px 0 0 22px;
	overflow: auto;
	overscroll-behavior: contain;
	touch-action: pan-x pan-y;
	background: var(--emst-bg);
}
.emst-stage.is-dragover::after { content: "Drop artwork to add it"; position: sticky; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 999px; background: var(--emst-accent); color: #fff; font-weight: 600; }
.emst-stage__inner { display: inline-block; min-width: 100%; min-height: 100%; box-sizing: border-box; }
.emst-stage { scrollbar-width: thin; scrollbar-color: rgba(60, 66, 80, 0.35) transparent; }
.emst-stage::-webkit-scrollbar { width: 10px; height: 10px; }
.emst-stage::-webkit-scrollbar-track { background: transparent; }
.emst-stage::-webkit-scrollbar-thumb { background: rgba(60, 66, 80, 0.3); border-radius: 10px; border: 2px solid var(--emst-bg); }
.emst-stage::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.emst-stage::-webkit-scrollbar-corner { background: transparent; }
.emst-artboard {
	position: relative;
	margin: 0 auto;
	touch-action: none;
	background: #fff;
	box-shadow: 0 6px 24px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.06);
	border-radius: 2px;
}
.emst-artboard.is-transparent { background: conic-gradient(#e3e5e8 25%, #fff 0 50%, #e3e5e8 0 75%, #fff 0) 0 0 / 20px 20px; }
.emst-artboard__svg { position: absolute; inset: 0; }
.emst-artboard__svg > svg.emst-artboard-svg,
.emst-artboard .emst-guides {
	display: block !important;
	position: absolute !important;
	left: 0 !important;
	top: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	fill: initial;
	stroke: none;
	stroke-width: 0;
	overflow: visible;
}
.emst-artboard__svg .emst-layer { cursor: move; }
.emst-artboard__svg .emst-layer.is-editing { opacity: 0; }
.emst-artboard__svg text { user-select: none; -webkit-user-select: none; }
.emst-guides { pointer-events: none; }
.emst-artboard.is-clean .emst-guides { display: none; }
.emst-guide-bleed { fill: var(--emst-bleed); }
.emst-guide-trim { fill: none; stroke: var(--emst-trim); opacity: 0.55; }
.emst-guide-safe { fill: none; stroke: var(--emst-safe); }
.emst-guide-snap { stroke: var(--emst-accent); }
.emst-guide-dieline { opacity: 0.85; pointer-events: none; }
.emst-legend__pill[data-guide="dieline"] i { border: 1.5px solid #7c3aed; border-radius: 50%; }
.emst-overlay { position: absolute; inset: 0; pointer-events: none; }
.emst-overlay > * { pointer-events: auto; }
.emst-selection {
	position: absolute;
	outline: 1.5px solid var(--emst-accent);
	outline-offset: -0.5px;
	transform-origin: center center;
	pointer-events: none;
}
.emst-selection.is-locked { outline-style: dashed; }
.emst-handle {
	position: absolute;
	width: 12px;
	height: 12px;
	background: #fff;
	border: 1.5px solid var(--emst-accent);
	border-radius: 3px;
	pointer-events: auto;
	touch-action: none;
}
.emst-handle--nw { left: -6px; top: -6px; cursor: nwse-resize; }
.emst-handle--n { left: calc(50% - 6px); top: -6px; cursor: ns-resize; }
.emst-handle--ne { right: -6px; top: -6px; cursor: nesw-resize; }
.emst-handle--e { right: -6px; top: calc(50% - 6px); cursor: ew-resize; }
.emst-handle--se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.emst-handle--s { left: calc(50% - 6px); bottom: -6px; cursor: ns-resize; }
.emst-handle--sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.emst-handle--w { left: -6px; top: calc(50% - 6px); cursor: ew-resize; }
.emst-handle--rotate {
	left: calc(50% - 13px);
	top: -40px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--emst-accent);
	cursor: grab;
}
.emst-handle--rotate svg { width: 14px; height: 14px; }
.emst-handle--rotate::before { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 14px; background: var(--emst-accent); }
.emst-seltools {
	position: absolute;
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: 8px;
	background: var(--emst-panel);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transform: translate(-50%, calc(-100% - 52px));
}
.emst-seltools .emst-btn--icon { width: 30px; min-height: 30px; }
.emst-seltools svg { width: 15px; height: 15px; }
.emst-inline-edit {
	position: absolute;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	resize: none;
	overflow: hidden;
	outline: none;
	transform-origin: center center;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.emst-legend { position: absolute; left: 34px; bottom: 14px; display: flex; gap: 6px; z-index: 3; }
.emst-legend__pill {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 11px;
	border: 1px solid var(--emst-line);
	border-radius: 999px;
	background: var(--emst-panel);
	color: var(--emst-muted);
	font: inherit;
	font-size: 12px;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.emst-legend__pill i { width: 10px; height: 10px; border-radius: 2px; }
.emst-legend__pill[data-guide="safe"] i { border: 1.5px dashed var(--emst-safe); }
.emst-legend__pill[data-guide="bleed"] i { background: rgba(226, 61, 90, 0.5); }
.emst-legend__pill.is-on { color: var(--emst-ink); border-color: color-mix(in srgb, var(--emst-accent) 45%, var(--emst-line)); }
.emst-zoom {
	position: absolute;
	right: 22px;
	bottom: 18px;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 3px;
	border-radius: 999px;
	background: var(--emst-panel);
	border: 1px solid var(--emst-line);
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
	z-index: 3;
}
.emst-zoom span { min-width: 46px; text-align: center; font-size: 12px; font-weight: 700; }
.emst-zoom .emst-btn--icon { width: 32px; min-height: 32px; border-radius: 50%; }

/* Side */
.emst-side { overflow-y: auto; padding: 18px 18px 40px; background: var(--emst-panel); border-left: 1px solid var(--emst-line); }
.emst-side__section + .emst-side__section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--emst-line); }
.emst-side__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.emst-side h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px !important; }
.emst-mockup { position: relative; border-radius: var(--emst-radius); overflow: hidden; background: var(--emst-soft); }
.emst-mockup__img { display: block; width: 100%; height: auto; }
.emst-mockup__overlay { position: absolute; object-fit: contain; transition: opacity 200ms ease; pointer-events: none; }
.emst-sheet { display: flex; align-items: center; justify-content: center; width: 100%; border-radius: var(--emst-radius); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); overflow: hidden; }
.emst-sheet.is-transparent { background: conic-gradient(#e3e5e8 25%, #fff 0 50%, #e3e5e8 0 75%, #fff 0) 0 0 / 16px 16px; }
.emst-sheet__img { display: block; width: 100%; height: 100%; object-fit: contain; }
.emst-variants { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.emst-variant { appearance: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.15); box-shadow: inset 0 0 0 2px #fff; cursor: pointer; padding: 0; }
.emst-variant.is-active { outline: 2px solid var(--emst-accent); outline-offset: 2px; }
.emst-surfaces { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.emst-surface-card {
	appearance: none;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 8px;
	border: 1px solid var(--emst-line);
	border-radius: var(--emst-radius);
	background: #fff;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.emst-surface-card.is-active { border-color: var(--emst-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--emst-accent) 25%, white); }
.emst-surface-card__thumb { display: block; position: relative; width: 100%; height: 0; border-radius: 6px; background: conic-gradient(#eceef1 25%, #fff 0 50%, #eceef1 0 75%, #fff 0) 0 0 / 12px 12px; overflow: hidden; }
.emst-surface-card__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.emst-surface-card__thumb img:not([src]) { visibility: hidden; }
.emst-surface-card__name { font-weight: 700; font-size: 13px; }
.emst-surface-card__meta { font-size: 11.5px; color: var(--emst-muted); }

/* Review */
.emst-review { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(12, 14, 18, 0.6); backdrop-filter: blur(4px); }
.emst-review[hidden] { display: none; }
.emst-review__inner { width: min(960px, 100%); max-height: 100%; overflow: auto; background: var(--emst-panel); border-radius: 14px; padding: 22px 24px 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.emst-review__loading { color: var(--emst-muted); text-align: center; padding: 30px; }
.emst-review__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.emst-review__head h2 { font-size: 20px; font-weight: 800; }
.emst-review__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.emst-proof { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 14px; border: 1px solid var(--emst-line); border-radius: var(--emst-radius); }
.emst-proof__img { width: 150px; border-radius: 6px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); overflow: hidden; }
.emst-proof__img.is-transparent { background: conic-gradient(#e3e5e8 25%, #fff 0 50%, #e3e5e8 0 75%, #fff 0) 0 0 / 14px 14px; }
.emst-proof__img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.emst-proof__body h3 { font-size: 15px; font-weight: 700; }
.emst-proof__meta { color: var(--emst-muted); font-size: 12.5px; margin: 4px 0 10px !important; }
.emst-review__note { margin: 14px 0 0 !important; color: var(--emst-muted); font-size: 13px; }
.emst-review__block { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0 !important; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--emst-poor) 8%, white); border: 1px solid color-mix(in srgb, var(--emst-poor) 30%, white); color: var(--emst-ink); }
.emst-review__block > svg { color: var(--emst-poor); margin-top: 2px; }
.emst-review__block > div { display: flex; flex-direction: column; gap: 6px; }
.emst-review__block strong { color: var(--emst-poor); }
.emst-review__block span { font-size: 13px; color: var(--emst-muted); }
.emst-review__block .emst-check { margin-top: 4px; }
.emst-review__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--emst-line); }
.emst-check { display: flex; align-items: flex-start; gap: 10px; max-width: 520px; font-size: 13.5px; cursor: pointer; }
.emst-check input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--emst-accent); flex: none; }
.emst-review__actions { display: flex; gap: 8px; margin-left: auto; }

/* Full-screen image library */
.emst-library { position: absolute; inset: 0; z-index: 11; display: flex; justify-content: center; padding: 22px; background: rgba(12, 14, 18, 0.55); backdrop-filter: blur(4px); }
.emst-library__inner { width: min(1320px, 100%); max-height: 100%; overflow: auto; background: var(--emst-panel); border-radius: 14px; padding: 20px 24px 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.emst-library .emst-masonry { columns: 5; column-gap: 12px; }
.emst-library .emst-tile { margin-bottom: 12px; }
.emst-library .emst-search { max-width: 640px; }
.emst-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.emst-panel__head .emst-panel__title { margin-bottom: 0 !important; }
.emst-fontpreview { display: block; margin-top: 6px; font-size: 20px; line-height: 1.2; color: var(--emst-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emst-beta { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--emst-accent) 12%, white); color: var(--emst-accent); font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }

/* Branding */
.emst-brand { display: inline-flex; align-items: center; gap: 8px; padding-right: 14px; margin-right: 4px; border-right: 1px solid var(--emst-line); max-width: 260px; }
.emst-brand__logo { display: block; max-height: 30px; max-width: 130px; width: auto; height: auto; }
.emst-brand__site { font-weight: 800; font-size: 14px; white-space: nowrap; }
.emst-brand__name { font-size: 13px; font-weight: 600; color: var(--emst-muted); white-space: nowrap; }
.emst-brand__badge { display: inline-block; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--emst-accent) 12%, white); color: var(--emst-accent); font-size: 10px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }

/* Help */
.emst-help { position: absolute; inset: 0; z-index: 11; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(12, 14, 18, 0.55); backdrop-filter: blur(4px); }
.emst-help__inner { width: min(640px, 100%); max-height: 100%; overflow: auto; background: var(--emst-panel); border-radius: 14px; padding: 22px 24px 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.emst-steps { list-style: none; margin: 0 !important; padding: 0 !important; counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.emst-steps li { position: relative; padding-left: 40px; counter-increment: step; }
.emst-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--emst-accent); color: var(--emst-accent-ink); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.emst-steps strong { display: block; font-size: 15px; margin-bottom: 2px; }
.emst-steps span { display: block; font-size: 13.5px; color: var(--emst-muted); line-height: 1.45; }
.emst-steps em { font-style: normal; font-weight: 600; color: var(--emst-ink); }
.emst-keys { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--emst-muted); }
.emst-keys kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--emst-line); border-bottom-width: 2px; border-radius: 5px; background: var(--emst-soft); color: var(--emst-ink); font: inherit; font-size: 11.5px; font-weight: 600; }
.emst-popover { position: absolute; z-index: 9; width: 290px; padding: 12px 14px; border-radius: 12px; background: var(--emst-panel); box-shadow: 0 12px 36px rgba(15, 23, 42, 0.22); border: 1px solid var(--emst-line); }
.emst-popover strong { display: block; font-size: 14px; margin-bottom: 4px; }
.emst-popover p { font-size: 12.5px; color: var(--emst-muted); line-height: 1.45; margin: 0 0 10px !important; }
.emst-popover__actions { display: flex; justify-content: flex-end; gap: 6px; }
.emst-panel { position: relative; }
.emst-panel__close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: none; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--emst-soft); color: var(--emst-ink); cursor: pointer; z-index: 2; }

/* Toasts */
.emst-toast-region { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100001; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.emst-toast {
	max-width: min(560px, calc(100vw - 32px));
	padding: 12px 18px;
	border-radius: 10px;
	background: #12151a;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 220ms ease, transform 220ms ease;
	pointer-events: auto;
}
.emst-toast.is-in { opacity: 1; transform: translateY(0); }
.emst-toast--success { background: var(--emst-good); }
.emst-toast--error { background: var(--emst-poor); }

/* ------------------------------------------------------------------ */
/* Mobile                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 899px) {
	.emst-shell { grid-template-rows: 52px 1fr; font-size: 14px; }
	.emst-topbar { grid-template-columns: auto auto 1fr auto; gap: 6px; padding: 0 8px; }
	.emst-brand { padding-right: 8px; margin-right: 0; gap: 6px; max-width: 120px; }
	.emst-brand__name, .emst-brand__badge { display: none; }
	.emst-brand__logo { max-height: 24px; max-width: 90px; }
	.emst-library { padding: 8px; }
	.emst-library__inner { padding: 14px; }
	.emst-library .emst-masonry { columns: 3; }
	.emst-topbar__status, .emst-topbar [data-action="undo"], .emst-topbar [data-action="redo"] { display: none; }
	.emst-topbar.has-brand { grid-template-columns: auto auto 1fr auto; }
	.emst-brand { padding-right: 8px; gap: 6px; }
	.emst-brand__logo { max-height: 24px; max-width: 96px; }
	.emst-brand__beta { display: none; }
	.emst-shell.panel-full .emst-panel { bottom: 68px; padding: 20px 14px 24px; }
	.emst-shell.panel-full .emst-masonry { columns: 3; }
	.emst-topbar__title strong { font-size: 14px; }
	.emst-topbar__meta { display: none; }
	.emst-topbar__preview { display: inline-flex; min-height: 36px; padding: 0 10px; }
	.emst-topbar__preview span, .emst-topbar__template span { display: none; }
	.emst-topbar__template { min-height: 36px; padding: 0 10px; }
	.emst-topbar__actions .emst-btn--primary { min-height: 36px; padding: 0 12px; font-size: 13px; }
	.emst-shell .emst-topbar__actions .emst-btn--primary { min-height: 36px !important; padding: 0 12px !important; }
	.emst-body { grid-template-columns: 1fr; grid-template-rows: 1fr 68px; }
	.emst-shell.has-wide-panel .emst-body { grid-template-columns: 1fr; }
	.emst-panel, .emst-shell.has-wide-panel .emst-panel { width: auto; }
	.emst-shell:not(.has-panel) .emst-panel { display: block; }
	/* Rail becomes a scrollable bottom bar */
	.emst-rail { flex-direction: row; justify-content: flex-start; grid-row: 2; gap: 2px; padding: 6px 6px; border-right: 0; border-top: 1px solid var(--emst-line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.emst-rail::-webkit-scrollbar { display: none; }
	.emst-rail__btn { flex: 0 0 66px; min-height: 54px; padding: 6px 2px; gap: 4px; font-size: 10.5px; }
	.emst-shell .emst-rail__btn { min-height: 54px !important; padding: 6px 2px !important; }
	.emst-rail__btn svg { width: 22px; height: 22px; }
	.emst-rail__btn--mobile { display: flex; }
	.emst-workspace { grid-row: 1; }
	.emst-side { display: none; }
	/* Panel is a bottom sheet */
	.emst-panel {
		position: absolute;
		left: 0; right: 0; bottom: 68px;
		max-height: 64%;
		border-right: 0;
		border-top: 1px solid var(--emst-line);
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
		padding: 22px 16px 24px;
		transform: translateY(105%);
		transition: transform 220ms ease;
		z-index: 5;
	}
	.emst-panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--emst-line); }
	.emst-panel__close { display: inline-flex; }
	.emst-shell.has-panel .emst-panel { transform: translateY(0); }
	.emst-panel__title { padding-right: 40px; }
	/* iOS zooms into inputs under 16px */
	.emst-shell .emst-input, .emst-shell select.emst-input, .emst-shell textarea.emst-input { font-size: 16px !important; }
	.emst-legend { top: 10px; left: 30px; bottom: auto; right: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
	.emst-legend::-webkit-scrollbar { display: none; }
	.emst-legend__pill { flex: none; }
	.emst-zoom { right: 10px; bottom: 12px; }
	.emst-shell.has-panel .emst-legend, .emst-shell.has-panel .emst-zoom { display: none; }
	.emst-stage__inner { padding: 24px; }
	.emst-handle { width: 16px; height: 16px; }
	.emst-handle--nw, .emst-handle--n, .emst-handle--ne { top: -8px; }
	.emst-handle--sw, .emst-handle--s, .emst-handle--se { bottom: -8px; }
	.emst-handle--nw, .emst-handle--w, .emst-handle--sw { left: -8px; }
	.emst-handle--ne, .emst-handle--e, .emst-handle--se { right: -8px; }
	.emst-handle--n, .emst-handle--s { left: calc(50% - 8px); }
	.emst-handle--e, .emst-handle--w { top: calc(50% - 8px); }
	.emst-handle--rotate { top: -44px; width: 30px; height: 30px; left: calc(50% - 15px); }
	.emst-seltools { transform: translate(-50%, calc(-100% - 58px)); }
	.emst-review { padding: 10px; }
	.emst-review__inner { padding: 16px; }
	.emst-proof { grid-template-columns: 96px 1fr; }
	.emst-proof__img { width: 96px; }
	.emst-review__foot { flex-direction: column; align-items: stretch; }
	.emst-review__actions { margin-left: 0; }
	.emst-review__actions .emst-btn { flex: 1; }
	.emst-help { padding: 10px; }
	.emst-help__inner { padding: 16px; }
	.emst-popover { width: min(290px, calc(100% - 20px)); }
	.emst-assets { grid-template-columns: repeat(4, 1fr); }
	.emst-shape-grid { grid-template-columns: repeat(7, 1fr); }
	.emst-templates { grid-template-columns: repeat(3, 1fr); }
	.emst-gradients { grid-template-columns: repeat(8, 1fr); }
	.emst-swatches--lg { grid-template-columns: repeat(8, 1fr); }
	.emst-masonry { columns: 2; }
	.emst-scale { display: none; }
	.emst-toast-region { bottom: 84px; }
}

@media (max-width: 480px) {
	.emst-library .emst-masonry { columns: 2; }
	.emst-assets { grid-template-columns: repeat(3, 1fr); }
	.emst-shape-grid { grid-template-columns: repeat(4, 1fr); }
	.emst-templates { grid-template-columns: 1fr 1fr; }
	.emst-swatches--lg { grid-template-columns: repeat(6, 1fr); }
	.emst-masonry { columns: 2; }
	.emst-shell .emst-topbar__actions .emst-btn--primary { padding: 0 10px !important; }
}

@media (prefers-reduced-motion: reduce) {
	.emst-shell *, .emst-toast, .emst-launch { transition: none !important; }
}

/* ------------------------------------------------------------------ */
/* Theme-proofing: themes style <button> globally; pin our faces       */
/* ------------------------------------------------------------------ */
.emst-shell button, .emst-launch-wrap button { text-shadow: none !important; text-transform: none !important; letter-spacing: normal !important; outline-offset: 2px; }
.emst-shell .emst-btn { color: var(--emst-ink) !important; background: var(--emst-soft) !important; border: 1px solid transparent !important; border-radius: 8px !important; box-shadow: none !important; padding: 0 16px !important; min-height: 38px !important; line-height: 1 !important; font-weight: 600 !important; }
.emst-shell .emst-btn:hover { background: #e9ebef !important; }
.emst-shell .emst-btn--primary { color: var(--emst-accent-ink) !important; background: var(--emst-accent) !important; }
.emst-shell .emst-btn--primary:hover { background: color-mix(in srgb, var(--emst-accent) 88%, black) !important; }
.emst-shell .emst-btn--ghost { background: transparent !important; border-color: var(--emst-line) !important; }
.emst-shell .emst-btn--ghost:hover { background: var(--emst-soft) !important; }
.emst-shell .emst-btn--ghost.is-active { border-color: var(--emst-accent) !important; color: var(--emst-accent) !important; }
.emst-shell .emst-btn--icon { background: transparent !important; padding: 0 !important; width: 36px; min-height: 36px !important; }
.emst-shell .emst-btn--icon:hover { background: rgba(0, 0, 0, 0.06) !important; }
.emst-shell .emst-btn--sm { min-height: 32px !important; padding: 0 12px !important; font-size: 13px !important; }
.emst-shell .emst-btn:disabled { opacity: 0.45 !important; }
.emst-shell .emst-topbar__actions .emst-btn--icon, .emst-shell .emst-seltools .emst-btn--icon { color: var(--emst-ink) !important; }
.emst-shell .emst-rail__btn { color: var(--emst-muted) !important; background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 10px !important; padding: 10px 4px 9px !important; min-height: 64px !important; line-height: 1.1 !important; }
.emst-shell .emst-rail__btn:hover { background: var(--emst-soft) !important; color: var(--emst-ink) !important; }
.emst-shell .emst-rail__btn.is-active { background: color-mix(in srgb, var(--emst-accent) 12%, white) !important; color: var(--emst-accent) !important; }
.emst-shell .emst-layer-row__main { background: transparent !important; color: var(--emst-ink) !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 8px !important; text-align: left !important; font-weight: 500 !important; min-height: 0 !important; }
.emst-shell .emst-layer-row.is-active .emst-layer-row__main { color: var(--emst-ink) !important; }
.emst-shell .emst-segment__btn { background: #fff !important; color: var(--emst-ink) !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 12px !important; min-height: 34px !important; }
.emst-shell .emst-segment__btn + .emst-segment__btn { border-left: 1px solid var(--emst-line) !important; }
.emst-shell .emst-segment__btn.is-active { background: color-mix(in srgb, var(--emst-accent) 12%, white) !important; color: var(--emst-accent) !important; }
.emst-shell .emst-asset__main { padding: 0 !important; min-height: 0 !important; border-radius: 10px !important; }
.emst-shell .emst-asset__main, .emst-shell .emst-template, .emst-shell .emst-surface-card, .emst-shell .emst-shape-btn, .emst-shell .emst-preset { background: #fff !important; color: var(--emst-ink) !important; border: 1px solid var(--emst-line) !important; box-shadow: none !important; }
.emst-shell .emst-preset { padding: 6px 10px !important; min-height: 0 !important; border-radius: 999px !important; }
.emst-shell .emst-tile { padding: 0 !important; min-height: 0 !important; border: 0 !important; background: var(--emst-soft) !important; color: var(--emst-ink) !important; box-shadow: none !important; }
.emst-shell .emst-tile.is-vector { border: 1px solid var(--emst-line) !important; background: #fff !important; padding: 6% !important; }
.emst-shell .emst-tab { background: none !important; border: 0 !important; border-bottom: 2px solid transparent !important; color: var(--emst-muted) !important; padding: 9px 12px 10px !important; min-height: 0 !important; box-shadow: none !important; }
.emst-shell .emst-tab.is-active { color: var(--emst-accent) !important; border-bottom-color: var(--emst-accent) !important; }
.emst-shell .emst-chip { background: #fff !important; color: var(--emst-ink) !important; border: 1px solid var(--emst-line) !important; padding: 6px 12px !important; min-height: 0 !important; box-shadow: none !important; font-weight: 500 !important; }
.emst-shell .emst-chip:hover, .emst-shell .emst-chip.is-active { border-color: var(--emst-accent) !important; color: var(--emst-accent) !important; background: color-mix(in srgb, var(--emst-accent) 6%, white) !important; }
.emst-shell .emst-search__clear { background: transparent !important; border: 0 !important; color: var(--emst-muted) !important; padding: 0 !important; min-height: 0 !important; }
.emst-shell .emst-gradient { padding: 0 !important; min-height: 28px !important; border: 1px solid rgba(0, 0, 0, 0.12) !important; box-shadow: none !important; }
.emst-shell .emst-asset__main:hover, .emst-shell .emst-template:hover, .emst-shell .emst-shape-btn:hover { border-color: var(--emst-accent) !important; }
.emst-shell .emst-shape-btn:hover { color: var(--emst-accent) !important; }
.emst-shell .emst-surface-card.is-active { border-color: var(--emst-accent) !important; }
.emst-shell .emst-asset__del { background: rgba(255, 255, 255, 0.92) !important; color: var(--emst-muted) !important; border: 0 !important; padding: 0 !important; min-height: 0 !important; }
.emst-shell .emst-asset__del:hover { color: var(--emst-poor) !important; border-color: var(--emst-poor) !important; }
.emst-shell .emst-legend__pill { background: var(--emst-panel) !important; color: var(--emst-muted) !important; border: 1px solid var(--emst-line) !important; border-radius: 999px !important; padding: 6px 11px !important; min-height: 0 !important; }
.emst-shell .emst-legend__pill.is-on { color: var(--emst-ink) !important; border-color: color-mix(in srgb, var(--emst-accent) 45%, var(--emst-line)) !important; }
.emst-shell .emst-linkbtn { background: none !important; color: var(--emst-accent) !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; min-height: 0 !important; }
.emst-shell .emst-swatch, .emst-shell .emst-variant { border: 1px solid rgba(0, 0, 0, 0.14) !important; box-shadow: inset 0 0 0 2px #fff !important; padding: 0 !important; min-height: 0 !important; }
.emst-shell .emst-swatch.is-active, .emst-shell .emst-variant.is-active { outline: 2px solid var(--emst-accent) !important; outline-offset: 2px !important; }
.emst-shell .emst-swatch--none { background: conic-gradient(#e5e7eb 25%, #fff 0 50%, #e5e7eb 0 75%, #fff 0) 0 0/10px 10px !important; }
.emst-shell .emst-swatch--custom { background: conic-gradient(from 90deg, #f43f5e, #f59e0b, #22c55e, #3b82f6, #a855f7, #f43f5e) !important; }
.emst-shell .emst-handle--rotate { padding: 0 !important; min-height: 0 !important; }
.emst-shell .emst-input, .emst-shell select.emst-input, .emst-shell textarea.emst-input { background: #fff !important; color: var(--emst-ink) !important; border: 1px solid var(--emst-line) !important; border-radius: 8px !important; box-shadow: none !important; padding: 6px 10px !important; min-height: 36px !important; font-size: 14px !important; line-height: 1.3 !important; text-transform: none !important; }
.emst-shell .emst-input:focus { outline: 2px solid var(--emst-accent) !important; outline-offset: -1px !important; border-color: transparent !important; }
.emst-shell .emst-input--num { padding: 6px 8px !important; }
.emst-shell .emst-input--text { min-height: 72px !important; }
.emst-shell label { margin: 0; text-transform: none; }
.emst-shell .emst-field__label { font-size: 12px !important; font-weight: 600 !important; color: var(--emst-muted) !important; }
.emst-shell h3.emst-panel__title { font-size: 17px !important; font-weight: 700 !important; letter-spacing: normal !important; text-transform: none !important; }
.emst-shell .emst-panel__sub { font-size: 12px !important; font-weight: 700 !important; color: var(--emst-muted) !important; letter-spacing: normal !important; text-transform: none !important; }

/* All sides view */
.emst-allsides { position: absolute; inset: 0; z-index: 11; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(12, 14, 18, 0.55); backdrop-filter: blur(4px); }
.emst-allsides__inner { width: min(1100px, 100%); max-height: 100%; overflow: auto; background: var(--emst-panel); border-radius: 14px; padding: 22px 24px 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.emst-allsides__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.emst-allside { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.emst-allside__sheet { width: 100%; border-radius: 8px; background: #fff; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.16); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.emst-allside__sheet.is-transparent { background: conic-gradient(#e3e5e8 25%, #fff 0 50%, #e3e5e8 0 75%, #fff 0) 0 0 / 16px 16px; }
.emst-allside__sheet img { width: 100%; height: 100%; object-fit: contain; display: block; }
.emst-allside__sheet img:not([src]) { visibility: hidden; }
.emst-allside.is-current .emst-allside__sheet { outline: 2px solid var(--emst-accent); outline-offset: 3px; }
.emst-allside figcaption { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.emst-allside figcaption strong { font-size: 14px; }
.emst-allside figcaption span { font-size: 12px; color: var(--emst-muted); }
.emst-allside figcaption .emst-btn { margin-top: 4px; }
.emst-topbar__sides[hidden] { display: none !important; }
@media (max-width: 899px) {
	.emst-allsides { padding: 10px; }
	.emst-allsides__inner { padding: 16px; }
	.emst-topbar__sides span { display: none; }
}
