/* 3D Text Studio (extension package). The modal chrome (backdrop,
   frame, header, close, selects, chips, tiles, buttons, scrollbars)
   comes from the editor's own modal design (dsm family) - the dialog
   mounts inside #wpie-root exactly for that. Only studio-specific
   layout lives here (prefix wpiefx- so the sibling 3D Mockup Studio
   never collides). */

.wpiefx-dialog {
	display: flex;
	flex-direction: column;
	width: min( 1120px, 96vw );
	height: min( 760px, 92vh );
}

.wpiefx-body {
	display: flex;
	flex: 1;
	min-height: 0;
}

.wpiefx-view {
	position: relative;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	background:
		repeating-conic-gradient(
			rgba( 128, 128, 128, 0.07 ) 0 25%,
			transparent 0 50%
		)
		0 0 / 22px 22px;
}

/* The scroll layer: the dialog sizes the canvas (fit x zoom); zoomed-in
   frames scroll here while hint + zoom pill stay pinned on the view. */
.wpiefx-scroll {
	position: absolute;
	inset: 0;
	display: flex;
	overflow: auto;
}

.wpiefx-view canvas {

	/* margin auto centers when smaller AND keeps every edge reachable
	   via scrollbars when zoomed beyond the viewport. */
	margin: auto;
	cursor: crosshair;
	border-radius: 4px;
}

.wpiefx-zoom {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 3px;
	border-radius: 8px;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #333a44 );
	opacity: 0.92;
	z-index: 3;
}

.wpiefx-zoom button {
	all: unset;
	cursor: pointer;
	width: 26px;
	height: 24px;
	display: grid;
	place-items: center;
	border-radius: 6px;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpiefx-zoom button:hover {
	background: rgba( 128, 148, 178, 0.18 );
	color: var( --ed-text, #e6e9ee );
}

.wpiefx-zoom-val {
	min-width: 42px;
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpiefx-view canvas:active {
	cursor: grabbing;
}

.wpiefx-hint {
	position: absolute;
	bottom: 10px;
	left: 12px;
	padding: 3px 9px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
	pointer-events: none;
	background: var( --ed-panel, #1d2126 );
	border-radius: 999px;
	opacity: 0.9;
}

.wpiefx-side {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 320px;
	padding: 14px;
	overflow-y: auto;
	border-left: 1px solid var( --ed-border, #333a44 );
}

.wpiefx-seg {
	display: flex;
}

.wpiefx-seg button {
	flex: 1;
}

.wpiefx-controls {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wpiefx-row {
	display: grid;
	grid-template-columns: 94px 1fr;
	gap: 8px;
	align-items: center;
}

.wpiefx-row.has-val {
	grid-template-columns: 94px 1fr 34px;
}

.wpiefx-row .dsm-label {
	overflow: hidden;
	font-size: 10.5px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpiefx-val {
	font-size: 10.5px;
	font-variant-numeric: tabular-nums;
	color: var( --ed-text-muted, #8b93a1 );
	text-align: right;
	white-space: nowrap;
}

/* Settings cards. */
.wpiefx-card {
	overflow: hidden;
	background: var( --ed-panel-alt, rgba( 255, 255, 255, 0.03 ) );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 10px;
}

.wpiefx-card-head {
	display: flex;
	gap: 9px;
	align-items: center;
	padding: 14px 16px 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var( --ed-text-dim, #b9c0cc );
	text-transform: uppercase;
}

.wpiefx-card-head svg {
	flex: none;
	opacity: 0.85;
}

.wpiefx-card-body {
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding: 9px 16px 15px;
}

/* Model picker tiles. */
.wpiefx-grid.wpiefx-models {
	grid-template-columns: repeat( 3, 1fr );
	max-height: 276px;
}

.wpiefx-models .dsm-tile {
	min-width: 0;
	padding: 5px 3px 4px;
}

.wpiefx-models .wpiefx-thumb {
	background: none;
}

.wpiefx-models .wpiefx-tile-label {
	font-size: 10px;
}

/* Body color presets. */
.wpiefx-swatches {
	display: flex;
	gap: 7px;
	padding: 2px 0 2px 68px;
}

.wpiefx-swatch {
	width: 18px;
	height: 18px;
	padding: 0;
	cursor: pointer;
	border: 1px solid rgba( 255, 255, 255, 0.35 );
	border-radius: 50%;
}

.wpiefx-dialog .wpiefx-colorhost input[type='color'] {
	width: 46px;
	height: 24px;
}

.wpiefx-swatch:hover {
	transform: scale( 1.15 );
}

.wpiefx-swatch.active {
	box-shadow: 0 0 0 2px var( --ed-bg, #14171c ),
		0 0 0 4px var( --accent, #3b66ff );
}

.wpiefx-colorhost {
	display: flex;
	align-items: center;
}

.wpiefx-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 88px, 1fr ) );
	gap: 8px;
	max-height: 320px;
	padding: 2px;
	overflow-y: auto;
}

.wpiefx-tile {
	position: relative;
	gap: 4px;
	padding: 8px 6px 6px;
}

.wpiefx-thumb {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background:
		repeating-conic-gradient(
			rgba( 128, 128, 128, 0.08 ) 0 25%,
			transparent 0 50%
		)
		0 0 / 12px 12px;
	border-radius: 4px;
}

.wpiefx-tile-badge {
	position: absolute;
	top: 4px;
	right: 4px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	font-size: 10px;
	font-weight: 700;
	line-height: 16px;
	color: #fff;
	text-align: center;
	background: var( --accent, #3b66ff );
	border-radius: 999px;
}

.wpiefx-tile-label {
	max-width: 100%;
	overflow: hidden;
	font-size: 10.5px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpiefx-sect {
	margin-top: 4px;
	padding-top: 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var( --ed-text-dim, #b9c0cc );
	text-transform: uppercase;
	border-top: 1px solid var( --ed-border, #333a44 );
}

.wpiefx-note {
	min-height: 14px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpiefx-dialog input[type='color'] {
	width: 100%;
	height: 28px;
	padding: 2px;
	cursor: pointer;
	background: var( --ed-panel-alt, #262b33 );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 6px;
}

/* The text input. */
.wpiefx-dialog textarea.wpiefx-text {
	min-height: 52px;
	font-size: 13px;
	line-height: 1.4;
	resize: vertical;
}

/* Transparent-background swatch. */
.wpiefx-swatch.wpiefx-checker {
	background:
		repeating-conic-gradient(
			rgba( 128, 128, 128, 0.45 ) 0 25%,
			rgba( 255, 255, 255, 0.14 ) 0 50%
		)
		0 0 / 8px 8px;
}

/* 360 spin export buttons. */
.wpiefx-spinrow {
	display: flex;
	gap: 8px;
}

.wpiefx-spinrow .ai-btn {
	flex: 1;
}

/* Text | Logo mode switch + logo controls. */
.wpiefx-mode {
	margin-bottom: 2px;
}

.wpiefx-checkbox {
	justify-self: start;
	width: 15px;
	height: 15px;
	accent-color: var( --accent, #3b66ff );
}

/* Checkbox rows: full-width label, control right-aligned. */
.wpiefx-row.wpiefx-wide {
	grid-template-columns: 1fr auto;
}

/* Per-letter color row. */
.wpiefx-letterrow {
	grid-template-columns: 94px auto 1fr;
}

.wpiefx-reset {
	justify-self: start;
	padding: 3px 9px;
	font-size: 11px;
	color: var( --ed-text-dim, #b9c0cc );
	cursor: pointer;
	background: var( --ed-panel-alt, #262b33 );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 6px;
}

.wpiefx-letterpanel {
	padding: 8px 10px 10px;
	background: var( --ed-panel, rgba( 0, 0, 0, 0.18 ) );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 8px;
}

.wpiefx-letterpanel .wpiefx-sect {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

/* FX Studio specifics. */
.wpiefx-status.error {
	color: #e5484d;
}

/* Flow drawing overlay + motion buttons (FX v2). */
.wpiefx-flowoverlay {
	position: absolute;
	pointer-events: none;
}

.wpiefx-flowbtns {
	display: flex;
	gap: 6px;
}

.wpiefx-flowbtns .ai-btn {
	flex: 1;
	justify-content: center;
}

.wpiefx-flowbtns .ai-btn.active {
	color: #7d9bff;
	border-color: rgba( 125, 155, 255, 0.55 );
}

.wpiefx-snippet {
	width: 100%;
	font-family: ui-monospace, monospace;
	font-size: 10px;
	line-height: 1.35;
	resize: vertical;
}

/* Extra light points (v2.5.0) */
#wpie-root .wpiefx-addlight { padding: 4px 10px; font-size: 12px; }
#wpie-root .wpiefx-lightrows { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
#wpie-root .wpiefx-lprow { display: flex; align-items: center; gap: 7px; }
#wpie-root .wpiefx-lprow input[type='color'] { width: 30px; height: 24px; padding: 0; border: 1px solid rgba(255,255,255,0.18); border-radius: 5px; background: none; flex: 0 0 30px; }
#wpie-root .wpiefx-lprange { flex: 1; min-width: 0; }
#wpie-root .wpiefx-lpbtn {
	all: unset;
	flex: 0 0 26px;
	width: 26px;
	height: 24px;
	display: grid;
	place-items: center;
	cursor: pointer;
	border-radius: 6px;
	border: 1px solid var( --ed-border, #333a44 );
	color: var( --ed-text-muted, #9aa1ab );
}
#wpie-root .wpiefx-lpbtn:hover {
	background: rgba( 128, 148, 178, 0.18 );
	color: var( --ed-text, #e6e9ee );
}

/* The side column is a flex column with its own scroll area. Without
   this the cards keep the default flex-shrink and get SQUEEZED instead
   of overflowing, so overflow-y never triggers and the panel simply has
   no scrollbar - the content below the fold becomes unreachable.
   (Bug class from 2026-07-17, fixed in five studios then; swept across
   the family on 2026-08-01.) */
#wpie-root .wpiefx-side > * {
	flex-shrink: 0;
}
