/* 3D Animation Studio (extension package). Modal chrome (backdrop, frame,
   header, selects, ranges, buttons) comes from the editor's own modal
   design (dsm family). Only the studio layout lives here: fullscreen
   frame, preview + properties row, and the timeline below. */

.wpieanim-dialog {
	display: flex;
	flex-direction: column;
	width: min( 1360px, 96vw );
	height: min( 850px, 94vh );
	max-width: none;
	max-height: none;
}

.wpieanim-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

.wpieanim-main {
	display: flex;
	flex: 1;
	min-height: 0;
}

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

.wpieanim-view.is-zoomed {
	overflow: auto;
}

/* margin:auto centers AND keeps the zoomed overflow reachable via scroll
   (grid centering clips the top-left corner once content overflows). */
.wpieanim-view canvas {
	margin: auto;
	border-radius: 4px;
	box-shadow: 0 6px 32px rgba( 0, 0, 0, 0.5 );
}

/* --------------------------- left panel (v1.13) -------------------------- */

.wpieanim-left {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 10px;
	width: 316px;
	padding: 12px;
	overflow-y: auto;
	border-right: 1px solid var( --ed-border, #333a44 );
}

/* Shorter labels on the left keep the scene sliders usable. */
.wpieanim-left .wpieanim-lbl {
	flex-basis: 96px;
}

.wpieanim-libdyn {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 10px;
}

.wpieanim-tiles {
	display: grid;
	grid-template-columns: repeat( 2, 1fr );
	gap: 6px;
}

#wpie-root .wpieanim-tile {
	display: flex;
	flex-direction: column;
	gap: 5px;
	align-items: center;
	justify-content: center;
	min-width: 0;
	padding: 9px 4px 7px;
	font-size: 10.5px;
	line-height: 1.15;
	color: var( --ed-text-muted, #9aa1ab );
	text-align: center;
	cursor: pointer;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #2a2f36 );
	border-radius: 10px;
}

#wpie-root .wpieanim-tile svg {
	width: 17px;
	height: 17px;
}

#wpie-root .wpieanim-tile:hover {
	color: var( --ed-text, #e6e9ee );
	border-color: var( --accent, #3b66ff );
}

#wpie-root .wpieanim-tile span {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ------------------------------ accordions ------------------------------- */

#wpie-root .wpieanim-acc-head {
	display: flex;
	gap: 9px;
	align-items: center;
	width: 100%;
	padding: 10px 14px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var( --ed-text-dim, #b9c0cc );
	text-align: left;
	text-transform: uppercase;
	cursor: pointer;
	background: none;
	border: 0;
}

.wpieanim-acc-ico {
	display: inline-flex;
	flex: none;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpieanim-acc-ttl {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpieanim-acc-badge {
	flex: none;
	padding: 1px 7px;
	font-size: 10px;
	font-weight: 600;
	color: var( --ed-text-muted, #9aa1ab );
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #2a2f36 );
	border-radius: 999px;
}

.wpieanim-acc-chev {
	flex: none;
	font-size: 10px;
	color: var( --ed-text-muted, #9aa1ab );
	transition: transform 0.15s ease;
	transform: rotate( -90deg );
}

.wpieanim-acc.is-open .wpieanim-acc-chev {
	transform: none;
}

.wpieanim-acc .wpieanim-card-body {
	padding-top: 2px;
}

/* ------------------------------ zoom overlay ----------------------------- */

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

#wpie-root .wpieanim-zoombtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 8px;
	font-size: 12px;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: none;
	border: 0;
	border-radius: 999px;
}

#wpie-root .wpieanim-zoombtn:hover {
	color: var( --ed-text, #e6e9ee );
	background: var( --ed-panel-alt, rgba( 255, 255, 255, 0.06 ) );
}

.wpieanim-zoomlbl {
	min-width: 40px;
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	color: var( --ed-text-muted, #9aa1ab );
	text-align: center;
}

/* --------------------------- inspector (right) --------------------------- */

.wpieanim-insphead {
	display: flex;
	flex: none;
	gap: 10px;
	align-items: center;
	padding: 2px 2px 0;
}

.wpieanim-insp-ico {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	color: var( --accent, #7dd3fc );
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #2a2f36 );
	border-radius: 8px;
}

.wpieanim-insp-t {
	min-width: 0;
}

.wpieanim-insp-name {
	overflow: hidden;
	font-size: 13px;
	font-weight: 600;
	color: var( --ed-text, #e6e9ee );
	text-overflow: ellipsis;
	white-space: nowrap;
}

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

.wpieanim-empty {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	padding: 42px 18px;
	text-align: center;
}

.wpieanim-empty-ico {
	display: inline-flex;
	color: var( --ed-text-muted, #9aa1ab );
	opacity: 0.7;
}

.wpieanim-empty-ico svg {
	width: 26px;
	height: 26px;
}

.wpieanim-empty-t {
	font-size: 12.5px;
	font-weight: 600;
	color: var( --ed-text-dim, #b9c0cc );
}

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

/* ------------------------------ properties ------------------------------ */

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

/* Cards follow the studio CI (the 3D Gallery Studio card, v1.8). */
.wpieanim-card {
	flex: none;
	overflow: hidden;
	background: var( --ed-panel-alt, rgba( 255, 255, 255, 0.03 ) );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 10px;
}

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

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

.wpieanim-prow {
	display: flex;
	gap: 8px;
	align-items: center;
	min-height: 24px;
}

.wpieanim-prow .dsm-select,
.wpieanim-prow .dsm-input {
	flex: 1;
	min-width: 0;
}

.wpieanim-prow .dsm-range {
	flex: 1;
	min-width: 0;
}

.wpieanim-lbl {
	flex: 0 0 98px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpieanim-val {
	flex: 0 0 38px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
	text-align: right;
}

.wpieanim-colorhost {
	display: inline-flex;
	flex: none;
}

/* Brand-kit swatches inline after the color button (v1.13). */
.wpieanim-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	min-width: 0;
}

#wpie-root .wpieanim-swatch {
	flex: none;
	width: 15px;
	height: 15px;
	padding: 0;
	cursor: pointer;
	border: 1px solid rgba( 255, 255, 255, 0.25 );
	border-radius: 50%;
}

#wpie-root .wpieanim-swatch:hover {
	border-color: var( --accent, #3b66ff );
	transform: scale( 1.15 );
}

.wpieanim-note {
	font-size: 12px;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpieanim-imgprev {
	max-width: 100%;
	max-height: 110px;
	object-fit: contain;
	border-radius: 6px;
	background:
		repeating-conic-gradient( rgba( 128, 128, 128, 0.12 ) 0 25%, transparent 0 50% )
		0 0 / 14px 14px;
}

.wpieanim-btns {
	flex-wrap: wrap;
}

#wpie-root .wpieanim-btns .ai-btn {
	padding: 5px 10px;
	font-size: 12px;
}

.wpieanim-file {
	display: none;
}

/* Starter templates (v1.1). */
.wpieanim-tpls {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

#wpie-root .wpieanim-tpl {
	padding: 4px 9px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #2a2f36 );
	border-radius: 14px;
}

#wpie-root .wpieanim-tpl:hover {
	color: var( --ed-text, #e8ebf0 );
	border-color: var( --accent, #3b66ff );
}

/* Choice + filter chips (v1.8, Gallery CI). */
.wpieanim-chiprow {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* The row label's 98px flex-basis would become HEIGHT in this column. */
.wpieanim-chiprow .wpieanim-lbl {
	flex: none;
}

.wpieanim-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

#wpie-root .wpieanim-chip {
	padding: 4px 9px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #2a2f36 );
	border-radius: 14px;
}

#wpie-root .wpieanim-chip.is-on {
	color: var( --ed-text, #e8ebf0 );
	background: var( --ed-panel-alt, #242932 );
	border-color: var( --accent, #3b66ff );
}

#wpie-root .wpieanim-chip:hover {
	border-color: var( --accent, #3b66ff );
}

#wpie-root .wpieanim-more {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	align-self: flex-start;
	padding: 2px 0;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: none;
	border: 0;
}

#wpie-root .wpieanim-more:hover {
	color: var( --ed-text, #e8ebf0 );
}

#wpie-root .wpieanim-num {
	width: 74px;
	flex: none;
}

/* Keyframes light (v1.9). */
#wpie-root .wpieanim-keybtn {
	align-self: flex-start;
	padding: 4px 10px;
	font-size: 11.5px;
	color: var( --ed-text, #e8ebf0 );
	cursor: pointer;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #2a2f36 );
	border-radius: 14px;
}

#wpie-root .wpieanim-keybtn:hover {
	border-color: var( --accent, #3b66ff );
}

.wpieanim-keyrow .wpieanim-mini {
	opacity: 0.8;
}


#wpie-root .wpieanim-key {
	position: absolute;
	top: 50%;
	z-index: 3;
	width: 9px;
	height: 9px;
	cursor: ew-resize;
	background: #fff;
	border: 1.5px solid rgba( 10, 12, 16, 0.75 );
	border-radius: 2px;
	transform: translate( -50%, -50% ) rotate( 45deg );
}

#wpie-root .wpieanim-key:hover {
	background: var( --accent, #3b66ff );
}

/* Transitions (v1.10): edge button on the entering clip + kind popover. */
#wpie-root .wpieanim-transbtn {
	position: absolute;
	top: 50%;
	left: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	padding: 0;
	font-size: 11px;
	line-height: 1;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #2a2f36 );
	border-radius: 50%;
	transform: translate( -50%, -50% );
}

#wpie-root .wpieanim-transbtn.is-on {
	color: #fff;
	background: var( --accent, #3b66ff );
	border-color: var( --accent, #3b66ff );
}

#wpie-root .wpieanim-transpop {
	position: fixed;
	z-index: 100010;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 280px;
	padding: 12px;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border-strong, #3a414d );
	border-radius: 10px;
	box-shadow: 0 10px 32px rgba( 0, 0, 0, 0.5 );
}

#wpie-root .wpieanim-ctx {
	position: fixed;
	z-index: 100010;
	display: flex;
	flex-direction: column;
	min-width: 170px;
	padding: 5px;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border-strong, #3a414d );
	border-radius: 9px;
	box-shadow: 0 10px 32px rgba( 0, 0, 0, 0.5 );
}

#wpie-root .wpieanim-ctxitem {
	padding: 6px 10px;
	font-size: 12px;
	color: var( --ed-text, #e8ebf0 );
	text-align: left;
	cursor: pointer;
	background: none;
	border: 0;
	border-radius: 6px;
}

#wpie-root .wpieanim-ctxitem:hover {
	background: var( --ed-hover, rgba( 255, 255, 255, 0.06 ) );
}

.wpieanim-transhead {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var( --ed-text-dim, #b9c0cc );
	text-transform: uppercase;
}

#wpie-root .wpieanim-ta {
	flex: 1;
	min-height: 48px;
	resize: vertical;
}

#wpie-root .wpieanim-reset {
	align-self: flex-end;
	padding: 4px 10px;
	font-size: 11px;
}

/* -------------------------------- timeline ------------------------------- */

.wpieanim-tl {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	max-height: 42%;
	border-top: 1px solid var( --ed-border, #333a44 );
	background: var( --ed-panel, #14171c );
}

.wpieanim-tlbar {
	display: flex;
	gap: 18px;
	align-items: center;
	justify-content: space-between;
	padding: 8px 14px;
	border-bottom: 1px solid var( --ed-border, #2a2f38 );
}

.wpieanim-tools {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

#wpie-root .wpieanim-fmt {
	width: 100%;
}

#wpie-root .wpieanim-dur {
	width: 64px;
}

#wpie-root .wpieanim-play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 30px;
	color: #fff;
	cursor: pointer;
	background: var( --accent, #3b66ff );
	border: 0;
	border-radius: 8px;
}

.wpieanim-time {
	min-width: 96px;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpieanim-tlscroll {
	position: relative;
	flex: 1;
	min-height: 96px;
	overflow: auto hidden;
	overflow-y: auto;
}

.wpieanim-ruler {
	position: sticky;
	top: 0;
	z-index: 3;
	height: 24px;
	cursor: ew-resize;
	background: var( --ed-panel, #14171c );
	border-bottom: 1px solid var( --ed-border, #2a2f38 );
}

.wpieanim-tick {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 1px;
	background: rgba( 255, 255, 255, 0.14 );
}

.wpieanim-tick span {
	position: absolute;
	top: 3px;
	left: 4px;
	font-size: 10px;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpieanim-rows {
	position: relative;
}

.wpieanim-row {
	display: flex;
	align-items: stretch;
	height: 34px;
	border-bottom: 1px solid rgba( 255, 255, 255, 0.05 );
}

.wpieanim-row.active {
	background: rgba( 59, 102, 255, 0.08 );
}

.wpieanim-rowlabel {
	display: flex;
	flex: 0 0 168px;
	gap: 7px;
	align-items: center;
	padding: 0 8px;
	overflow: hidden;
	font-size: 12px;
	color: var( --ed-text, #dfe3ea );
	cursor: pointer;
	border-right: 1px solid var( --ed-border, #2a2f38 );
}

.wpieanim-rowlabel svg {
	flex: none;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpieanim-rowname {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpieanim-rowops {
	display: none;
	gap: 2px;
}

.wpieanim-row:hover .wpieanim-rowops {
	display: inline-flex;
}

#wpie-root .wpieanim-mini {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	padding: 0;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: transparent;
	border: 0;
	border-radius: 5px;
}

#wpie-root .wpieanim-mini:hover {
	color: #fff;
	background: rgba( 255, 255, 255, 0.1 );
}

.wpieanim-track {
	position: relative;
	flex: 1;
	min-width: 0;
}

.wpieanim-clip {
	position: absolute;
	top: 5px;
	bottom: 5px;
	min-width: 10px;
	cursor: grab;
	background: linear-gradient( 180deg, #3b66ff, #2749c4 );
	border: 1px solid rgba( 255, 255, 255, 0.25 );
	border-radius: 7px;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.35 );
}

.wpieanim-clip:active {
	cursor: grabbing;
}

.wpieanim-clip-text3d {
	background: linear-gradient( 180deg, #d9a53f, #a9781f );
}

.wpieanim-clip-ptext {
	background: linear-gradient( 180deg, #9a6bff, #6a3fd1 );
}

.wpieanim-clip-image {
	background: linear-gradient( 180deg, #2fb4a8, #1d8078 );
}

.wpieanim-clip-effect {
	background: linear-gradient( 180deg, #e05c9a, #ad3a71 );
}

.wpieanim-clip-shape {
	background: linear-gradient( 180deg, #5b6b82, #3c4757 );
}

.wpieanim-handle {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 9px;
	cursor: ew-resize;
}

.wpieanim-handle.l {
	left: -2px;
	border-radius: 7px 0 0 7px;
}

.wpieanim-handle.r {
	right: -2px;
	border-radius: 0 7px 7px 0;
}

.wpieanim-handle::after {
	position: absolute;
	top: 7px;
	bottom: 7px;
	left: 3px;
	width: 2px;
	content: '';
	background: rgba( 255, 255, 255, 0.55 );
	border-radius: 2px;
}

.wpieanim-playhead {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 4;
	width: 2px;
	pointer-events: none;
	background: #ff5470;
	box-shadow: 0 0 6px rgba( 255, 84, 112, 0.8 );
}

.wpieanim-ruler-label {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 168px;
	background: var( --ed-panel, #14171c );
	border-right: 1px solid var( --ed-border, #2a2f38 );
}

.wpieanim-check {
	gap: 8px;
	font-size: 12px;
	color: var( --ed-text, #dfe3ea );
	cursor: pointer;
}

/* Toolbar tool buttons (undo/redo/zoom, v1.4). */
#wpie-root .wpieanim-tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	color: var( --ed-text, #dfe3ea );
	cursor: pointer;
	background: var( --ed-bg, #1b1f26 );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 8px;
}

#wpie-root .wpieanim-tool:disabled {
	cursor: default;
	opacity: 0.35;
}

#wpie-root .wpieanim-tool:not(:disabled):hover {
	border-color: var( --accent, #3b66ff );
}

.wpieanim-tlinner {
	position: relative;
	min-width: 100%;
}
