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

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

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

.wpiepty-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;
}

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

.wpiepty-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 );
}

.wpiepty-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% );
}

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

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

.wpiepty-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 );
}

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

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

.wpiepty-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 );
}

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

.wpiepty-wide {
	width: 100%;
}

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

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

.wpiepty-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;
}

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

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

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

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

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

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

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

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

.wpiepty-pals { display: flex; flex-wrap: wrap; gap: 6px; }
.wpiepty-pal { flex: none; width: 42px; height: 20px; cursor: pointer; border: 1px solid var( --ed-border, #333a44 ); border-radius: 5px; }
.wpiepty-pal.sel { border-color: var( --ed-accent, #3b82f6 ); box-shadow: 0 0 0 1px var( --ed-accent, #3b82f6 ); }
.wpiepty-text-row { margin: 6px 0; }
.wpiepty-text-row > span { display: block; margin-bottom: 3px; font-size: 11px; color: var( --ed-text-muted, #9aa1ab ); }
.wpiepty-text-row input { width: 100%; padding: 7px 9px; font-size: 12px; color: inherit; background: var( --ed-bg, #14171c ); border: 1px solid var( --ed-border, #333a44 ); border-radius: 6px; outline: none; }

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

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

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

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

.wpiepty-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;
}

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

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

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

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

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

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

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

.wpiepty-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;
}
