/* Stitch Patterns (extension package). Modal chrome comes from the
   editor's dsm design system - only studio-specific parts live here. */

.wpiestp-dialog {
	width: min( 1060px, 96vw );
	height: min( 720px, 92vh );
}

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

.wpiestp-view {
	position: relative;
	display: grid;
	flex: 1;
	place-items: center;
	min-width: 0;
	background:
		repeating-conic-gradient(
			rgba( 128, 128, 128, 0.07 ) 0 25%,
			transparent 0 50%
		)
		0 0 / 22px 22px;
}

.wpiestp-view canvas {
	max-width: calc( 100% - 36px );
	max-height: calc( 100% - 36px );
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.35 );
}

.wpiestp-empty {
	position: absolute;
	max-width: 300px;
	padding: 14px 18px;
	font-size: 13px;
	line-height: 1.5;
	color: var( --ed-text, #e6e8ee );
	text-align: center;
	pointer-events: none;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.3 );
}

.wpiestp-status {
	position: absolute;
	bottom: 14px;
	left: 50%;
	display: none;
	max-width: 78%;
	padding: 7px 14px;
	font-size: 11px;
	color: var( --ed-text, #e6e8ee );
	text-align: center;
	pointer-events: none;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 999px;
	transform: translateX( -50% );
}

.wpiestp-status.on {
	display: block;
}

.wpiestp-status.err {
	color: #f28b82;
	border-color: rgba( 242, 139, 130, 0.5 );
}

.wpiestp-side {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 10px;
	width: 332px;
	padding: 12px 14px;
	overflow-x: hidden;
	overflow-y: auto;
	font-size: 12px;
	border-left: 1px solid var( --ed-border, #333a44 );
}

.wpiestp-side > * {
	flex-shrink: 0;
}

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

.wpiestp-card-head {
	padding: 10px 12px 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --ed-text-dim, #b9c0cc );
}

.wpiestp-card-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 8px 12px 12px;
}

.wpiestp-wide {
	width: 100%;
}

.wpiestp-info {
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpiestp-modes {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.wpiestp-mode {
	flex: 1 1 44%;
	padding: 7px 6px;
	font-size: 11.5px;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: none;
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 6px;
}

.wpiestp-mode:hover {
	color: inherit;
}

.wpiestp-mode.sel {
	color: var( --ed-accent, #3b82f6 );
	border-color: var( --ed-accent, #3b82f6 );
	box-shadow: 0 0 0 1px var( --ed-accent, #3b82f6 );
}

.wpiestp-row {
	display: grid;
	grid-template-columns: 92px 1fr auto;
	gap: 8px;
	align-items: center;
	margin: 2px 0;
}

.wpiestp-row > span {
	overflow: hidden;
	white-space: nowrap;
}

.wpiestp-row input[type='range'] {
	width: 100%;
	accent-color: var( --ed-accent, #3b82f6 );
}

.wpiestp-row output {
	min-width: 34px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
	text-align: right;
}

#wpie-root .wpiestp-check {
	display: inline-flex;
	gap: 7px;
	align-items: center;
	cursor: pointer;
}

#wpie-root .wpiestp-check input {
	width: 15px;
	height: 15px;
	accent-color: var( --accent, #3b66ff );
}

/* v2 - CI-grade panel: icon card heads, craft preview cards, palettes */

.wpiestp-card-head {
	display: flex;
	gap: 8px;
	align-items: center;
}

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

.wpiestp-cards {
	display: grid;
	grid-template-columns: repeat( 2, 1fr );
	gap: 8px;
}

.wpiestp-tcard {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 6px;
	cursor: pointer;
	background: var( --ed-bg, #14171c );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 8px;
}

.wpiestp-tcard:hover {
	border-color: var( --ed-text-muted, #9aa1ab );
}

.wpiestp-tcard.sel {
	border-color: var( --ed-accent, #3b82f6 );
	box-shadow: 0 0 0 1px var( --ed-accent, #3b82f6 );
}

.wpiestp-tthumb {
	width: 100%;
	border-radius: 4px;
}

.wpiestp-tlabel {
	overflow: hidden;
	font-size: 10.5px;
	color: var( --ed-text-dim, #b9c0cc );
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpiestp-pals {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.wpiestp-pal {
	flex: none;
	width: 42px;
	height: 20px;
	cursor: pointer;
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 5px;
}

.wpiestp-pal.sel {
	border-color: var( --ed-accent, #3b82f6 );
	box-shadow: 0 0 0 1px var( --ed-accent, #3b82f6 );
}

.wpiestp-customrow {
	grid-template-columns: 92px 1fr auto;
}

.wpiestp-customs {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.wpiestp-reset {
	padding: 3px 10px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: none;
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 6px;
}

.wpiestp-reset:hover {
	color: inherit;
}

.wpiestp-text-row {
	margin: 6px 0;
}

.wpiestp-text-row > span {
	display: block;
	margin-bottom: 3px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpiestp-names {
	width: 100%;
	padding: 7px 9px;
	font-size: 12px;
	color: inherit;
	resize: vertical;
	background: var( --ed-bg, #14171c );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 6px;
	outline: none;
}

.wpiestp-text-row .wpie-font-mount {
	width: 100%;
}
