/* Web Image Editor Suite (Skeleton) - Canva-inspired UI refresh (v0.2.2) */
:root {
	--wie-bg: #f6f5fb;
	--wie-surface: #ffffff;
	--wie-surface-2: #fbfbff;
	--wie-border: #e7e4f2;
	--wie-border-2: #efeef7;
	--wie-text: #1f2430;
	--wie-muted: #666c7a;
	--wie-accent: #7c4dff;
	--wie-accent-soft: #f0eaff;
	--wie-shadow: 0 8px 28px rgba(34, 24, 70, .08);
}

.wie-editor-wrap {
	border: 1px solid var(--wie-border);
	background: var(--wie-bg);
	margin: 18px 0;
	box-sizing: border-box;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: var(--wie-shadow);
	color: var(--wie-text);
}
/* Break out of narrow theme containers for app-like feel */
.wie-editor-wrap.wie-editor-fullscreen {
	/* Force full-bleed even inside narrow theme containers */
	width: 100vw !important;
	max-width: 100vw !important;
	min-width: 100vw !important;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw !important;
	margin-right: -50vw !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
}
.wie-editor-wrap * {
	box-sizing: border-box;
}
.wie-editor-fullscreen {
	display: flex;
	flex-direction: column;
	min-height: calc(100svh - var(--wie-chrome-offset, 0px));
	height: calc(100svh - var(--wie-chrome-offset, 0px));
	max-height: calc(100svh - var(--wie-chrome-offset, 0px));
}

.wie-editor-wrap.wie-editor-locked {
	padding: 18px;
	background: var(--wie-surface);
}
.wie-editor-header {
	padding: 12px 16px 8px;
	border-bottom: 1px solid var(--wie-border-2);
	background: linear-gradient(180deg, #fbfaff 0%, #f7f6fd 100%);
}
.wie-editor-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -.01em;
}
.wie-editor-desc {
	margin: 4px 0 0;
	color: var(--wie-muted);
	font-size: 13px;
}
.wie-editor-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--wie-border-2);
	background: rgba(255,255,255,.85);
	backdrop-filter: blur(6px);
}
.wie-editor-toolbar .wie-canvas-meta {
	margin: 0;
	font-size: 12px;
	color: var(--wie-muted);
}
.wie-editor-layout {
	display: grid;
	grid-template-columns: 304px minmax(0, 1fr);
	gap: 0;
	align-items: stretch;
	flex: 1 1 auto;
	min-height: 0;
	height: 100%; /* ensure stage can grow */
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-layout {
	grid-template-columns: minmax(0, 1fr) !important;
}
.wie-editor-left {
	border-right: 1px solid var(--wie-border-2);
	background: #f4f2fb;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	transition: width .18s ease, opacity .18s ease;
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-left {
	display: none !important;
	width: 0;
	opacity: 0;
	border-right: 0;
}
.wie-editor-left-scroll {
	height: 100%;
	overflow-y: auto;
	padding: 12px;
	display: grid;
	gap: 10px;
	scrollbar-width: thin;
	scrollbar-color: #cfc8e6 transparent;
}
.wie-editor-left-scroll::-webkit-scrollbar { width: 10px; }
.wie-editor-left-scroll::-webkit-scrollbar-thumb { background: #d7d1ea; border-radius: 12px; border: 2px solid transparent; background-clip: content-box; }

.wie-panel {
	border: 1px solid transparent;
	border-radius: 12px;
	padding: 10px;
	background: transparent;
}
.wie-panel:hover {
	background: rgba(255,255,255,.45);
	border-color: rgba(124,77,255,.08);
}
.wie-panel h4 {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .01em;
	display: flex;
	align-items: center;
	gap: 8px;
}
.wie-panel h4::before {
	content: "";
	width: 18px;
	height: 18px;
	border-radius: 6px;
	border: 1px solid #d8d3ea;
	background: #fff;
	box-shadow: inset 0 0 0 3px #f4f2fb;
	flex: 0 0 18px;
}
.wie-panel-start h4::before { box-shadow: inset 0 0 0 3px #efe8ff; border-color: #cab8ff; }
.wie-panel-crop h4::before { box-shadow: inset 0 0 0 3px #e8f5ff; border-color: #b7dfff; }
.wie-panel-rotate h4::before { box-shadow: inset 0 0 0 3px #eefbf1; border-color: #b8e6c1; }
.wie-panel-resize h4::before { box-shadow: inset 0 0 0 3px #fff6e8; border-color: #f0d39c; }
.wie-panel-colors h4::before { box-shadow: inset 0 0 0 3px #fff0f6; border-color: #f2b5cd; }
.wie-panel-export h4::before { box-shadow: inset 0 0 0 3px #edefff; border-color: #c2c8ff; }
.wie-panel-history h4::before { box-shadow: inset 0 0 0 3px #f3f3f3; border-color: #dadada; }

.wie-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.wie-field-row {
	margin-bottom: 8px;
}
.wie-field-row:last-child {
	margin-bottom: 0;
}
.wie-field-row label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--muted, #555d6d);
	margin-bottom: 4px;
}
.wie-input,
.wie-range,
.wie-field-row select,
.wie-field-row input[type="number"],
.wie-field-row input[type="text"],
.wie-field-row input[type="file"] {
	width: 100%;
	max-width: 100%;
}
.wie-editor-wrap input[type="number"],
.wie-editor-wrap input[type="text"],
.wie-editor-wrap select,
.wie-editor-wrap input[type="file"] {
	border: 1px solid var(--wie-border);
	background: #fff;
	border-radius: 10px;
	padding: 7px 10px;
	font-size: 13px;
	line-height: 1.2;
	box-shadow: none;
}
.wie-editor-wrap input[type="number"]:focus,
.wie-editor-wrap input[type="text"]:focus,
.wie-editor-wrap select:focus,
.wie-editor-wrap input[type="file"]:focus {
	outline: none;
	border-color: #c2b0ff;
	box-shadow: 0 0 0 3px rgba(124,77,255,.12);
}
.wie-editor-wrap input[type="file"] {
	padding: 7px;
	background: var(--wie-surface-2);
}
.wie-editor-wrap input[type="range"] {
	accent-color: var(--wie-accent);
}

.wie-btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}
.wie-editor-wrap .button,
.wie-editor-wrap .button.button-primary,
.wie-editor-wrap .button-primary {
	border: 1px solid var(--wie-border);
	background: #fff;
	color: var(--wie-text);
	border-radius: 10px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.25;
	min-height: 34px;
	box-shadow: none;
	text-shadow: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.wie-editor-wrap .button:hover,
.wie-editor-wrap .button.button-primary:hover,
.wie-editor-wrap .button-primary:hover {
	background: #fff;
	border-color: #cfc7e8;
	color: #161b26;
}
.wie-editor-wrap .button:focus,
.wie-editor-wrap .button.button-primary:focus,
.wie-editor-wrap .button-primary:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(124,77,255,.12);
}
/* remove big WP blue primary feel */
.wie-editor-wrap .button.button-primary,
.wie-editor-wrap .button-primary.wie-create-blank,
.wie-editor-wrap .button-primary.wie-download {
	background: #fff;
	border-color: #d8d3ea;
	color: var(--wie-text);
}
/* soft accents for important actions */
.wie-editor-wrap .wie-create-blank,
.wie-editor-wrap .wie-download {
	background: var(--wie-accent-soft) !important;
	border-color: #d7c7ff !important;
	color: #5f35cf !important;
}
.wie-output {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	margin-left: 6px;
	font-size: 11px;
	font-weight: 700;
	color: #4b5567;
	background: #fff;
	border: 1px solid var(--wie-border);
	border-radius: 999px;
	padding: 2px 8px;
}

.wie-editor-right {
	min-width: 0;
	min-height: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	background: #f7f6fc;
}
.wie-canvas-stage {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	overflow: hidden;
	border: 0;
	background:
		radial-gradient(circle at 1px 1px, rgba(130, 135, 155, .13) 1px, transparent 0) 0 0 / 18px 18px,
		linear-gradient(180deg, #fafafe 0%, #f4f3fb 100%);
	padding: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wie-canvas {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	background: transparent;
	box-shadow: 0 12px 38px rgba(31, 36, 48, .12), 0 1px 0 rgba(255,255,255,.9) inset;
	border-radius: 10px;
	image-rendering: auto;
}

.wie-canvas-help {
	padding: 6px 10px;
	color: var(--wie-muted);
	border-top: 1px solid var(--wie-border-2);
	background: rgba(255,255,255,.82);
	font-size: 11px;
	line-height: 1.35;
}
.wie-status {
	min-height: 18px;
	margin: 8px 0 0;
	font-size: 12px;
	font-weight: 600;
	color: #5f35cf;
}
.wie-panel[hidden] {
	display: none !important;
}

/* Canva-ish compact sidebar section rhythm */
.wie-panel-start,
.wie-panel-history {
	background: rgba(255,255,255,.55);
	border-color: rgba(124,77,255,.08);
}
.wie-panel + .wie-panel {
	border-top: 1px dashed rgba(124,77,255,.08);
}

/* Collapse toggle as icon + text */
.wie-menu-toggle {
	position: relative;
	padding-left: 10px !important;
}
.wie-menu-toggle::before {
	content: "◀";
	font-size: 10px;
	display: inline-block;
	margin-right: 2px;
	transform: translateY(-1px);
	color: #6c55b6;
}
.wie-editor-wrap.wie-menu-collapsed .wie-menu-toggle::before {
	content: "▶";
}


/* Theme compatibility: many themes force content max-width on children */
.wie-editor-wrap.wie-editor-fullscreen.alignfull,
.alignfull .wie-editor-wrap.wie-editor-fullscreen,
.entry-content > .wie-editor-wrap.wie-editor-fullscreen,
.wp-block-post-content > .wie-editor-wrap.wie-editor-fullscreen {
	width: 100vw !important;
	max-width: 100vw !important;
	min-width: 100vw !important;
	margin-left: -50vw !important;
	margin-right: -50vw !important;
	left: 50% !important;
	right: 50% !important;
}
body.wie-editor-active {
	overflow-x: hidden;
}
.wie-editor-right, .wie-editor-layout, .wie-canvas-stage {
	min-height: 0;
}

@media (max-width: 980px) {
	.wie-editor-wrap.wie-editor-fullscreen {
		width: 100%;
		max-width: 100%;
		margin-left: 0;
		margin-right: 0;
		border-left: 1px solid var(--wie-border);
		border-right: 1px solid var(--wie-border);
		border-radius: 14px;
	}
	.wie-editor-fullscreen {
		height: auto;
		max-height: none;
		min-height: 0;
	}
	.wie-editor-layout {
		grid-template-columns: 1fr;
	}
	.wie-editor-wrap.wie-menu-collapsed .wie-editor-layout {
		grid-template-columns: 1fr;
	}
	.wie-editor-left {
		border-right: 0;
		border-bottom: 1px solid var(--wie-border-2);
	}
	.wie-editor-wrap.wie-menu-collapsed .wie-editor-left {
		display: none;
		opacity: 1;
		width: auto;
	}
	.wie-canvas-stage {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	overflow: hidden;
	border: 0;
	background:
		radial-gradient(circle at 1px 1px, rgba(130, 135, 155, .13) 1px, transparent 0) 0 0 / 18px 18px,
		linear-gradient(180deg, #fafafe 0%, #f4f3fb 100%);
	padding: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
}

	.wie-editor-toolbar {
		flex-wrap: wrap;
		align-items: flex-start;
	}
}

/* Live preview UX: hide Apply buttons (changes commit on interaction) */
.wie-apply-colors, .wie-apply-crop, .wie-apply-resize { display:none !important; }

.wie-editor-wrap.wie-editor-fullscreen { overflow: hidden; }


/* Menu collapse keeps the top bars visible for stable sizing; only the sidebar is removed so the stage width grows immediately. */
.wie-editor-wrap.wie-menu-collapsed .wie-canvas-stage {
	padding: 12px;
}



/* harden fullscreen + stage sizing */
.wie-editor-fullscreen > .wie-editor-layout { flex: 1 1 auto; min-height: 0; }
.wie-editor-fullscreen .wie-editor-right { flex: 1 1 auto; min-height: 0; }
.wie-editor-fullscreen .wie-canvas-stage { min-width: 0; min-height: 0; }


/* v0.2.7 layout fix: stable flex workspace so collapse actually enlarges canvas */
.wie-editor-layout{
  display:flex !important;
  grid-template-columns:none !important;
  align-items:stretch;
  flex:1 1 auto;
  min-height:0 !important;
  height:auto !important;
}
.wie-editor-left{
  flex:0 0 304px;
  width:304px;
  min-width:304px;
  max-width:304px;
}
.wie-editor-right{
  flex:1 1 auto !important;
  min-width:0 !important;
  min-height:0 !important;
  height:auto !important;
}
.wie-canvas-stage{
  flex:1 1 auto !important;
  min-width:0 !important;
  min-height:0 !important;
  overflow:hidden !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-left{
  display:none !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-right{
  width:100% !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-canvas-stage{
  padding:10px !important;
}
/* Let JS control preview size exactly; avoid CSS max-* fighting after collapse */
.wie-canvas{
  max-width:none !important;
  max-height:none !important;
  width:auto;
  height:auto;
}
@media (max-width:980px){
  .wie-editor-layout{display:block !important;height:auto !important;}
  .wie-editor-left{width:auto;min-width:0;max-width:none;}
}


/* v0.2.8 collapse = focus canvas mode: reclaim vertical space so canvas actually grows */
.wie-editor-wrap.wie-menu-collapsed .wie-editor-header{
  display:none !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-canvas-help{
  display:none !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-toolbar{
  padding:6px 10px !important;
  min-height:40px;
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-toolbar .wie-canvas-meta{
  font-size:11px;
}
.wie-editor-wrap.wie-menu-collapsed .wie-canvas-stage{
  padding:8px !important;
}
/* Ensure right pane can fully consume space after sidebar removal */
.wie-editor-wrap.wie-menu-collapsed .wie-editor-layout,
.wie-editor-wrap.wie-menu-collapsed .wie-editor-right{
  min-height:0 !important;
  flex:1 1 auto !important;
}


/* v0.2.9 collapse fix: reclaim real height and keep toggle accessible as overlay */
.wie-editor-right{ position:relative; }
.wie-editor-wrap.wie-menu-collapsed .wie-editor-header{ display:none !important; }
.wie-editor-wrap.wie-menu-collapsed .wie-canvas-help{ display:none !important; }
/* Remove toolbar from document flow so stage gets the height. Keep only the menu toggle as overlay. */
.wie-editor-wrap.wie-menu-collapsed .wie-editor-toolbar{
  position:absolute !important;
  top:10px;
  left:10px;
  right:auto;
  z-index:20;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  backdrop-filter:none !important;
  min-height:0 !important;
  box-shadow:none !important;
  pointer-events:none;
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-toolbar .wie-canvas-meta{
  display:none !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-toolbar .wie-menu-toggle{
  pointer-events:auto;
  margin:0;
  min-height:32px;
  padding:5px 10px !important;
  background:rgba(255,255,255,.92) !important;
  border:1px solid var(--wie-border) !important;
  box-shadow:0 4px 16px rgba(31,36,48,.08);
}
/* Make stage truly use the freed space */
.wie-editor-wrap.wie-menu-collapsed .wie-editor-layout,
.wie-editor-wrap.wie-menu-collapsed .wie-editor-right,
.wie-editor-wrap.wie-menu-collapsed .wie-canvas-stage{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:auto !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-canvas-stage{
  padding:4px !important;
}
/* Optional subtle canvas chrome reduction in focus mode */
.wie-editor-wrap.wie-menu-collapsed .wie-canvas{
  border-radius:8px;
}


/* ===== v0.3.0 collapse focus-mode hard override ===== */
.wie-editor-wrap.wie-editor-fullscreen {
  position: relative !important;
}
.wie-editor-wrap.wie-editor-fullscreen .wie-editor-layout {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
}
.wie-editor-wrap.wie-editor-fullscreen .wie-editor-left {
  flex: 0 0 304px !important;
  width: 304px !important;
  display: block !important;
}
.wie-editor-wrap.wie-editor-fullscreen .wie-editor-right {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
.wie-editor-wrap.wie-editor-fullscreen .wie-canvas-stage {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
}
.wie-editor-wrap.wie-editor-fullscreen .wie-canvas {
  max-width: none !important;
  max-height: none !important;
}

/* Collapsed = true focus mode (canvas takes the full editor area) */
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed {
  padding: 0 !important;
}
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-editor-header,
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-canvas-help {
  display: none !important;
}
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-editor-layout {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
}
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-editor-left {
  display: none !important;
  width: 0 !important;
  flex: 0 0 0 !important;
}
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-editor-right {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  position: relative !important;
}
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-canvas-stage {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  padding: 8px !important;
  border: 0 !important;
}
/* Make toolbar floating overlay so it doesn't consume layout height */
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-editor-toolbar {
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  right: auto !important;
  z-index: 50 !important;
  border: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  pointer-events: none !important;
}
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-editor-toolbar .wie-canvas-meta {
  display: none !important;
}
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-editor-toolbar .wie-menu-toggle {
  pointer-events: auto !important;
  background: rgba(255,255,255,.94) !important;
  border: 1px solid var(--wie-border) !important;
  box-shadow: 0 6px 18px rgba(20,20,20,.10) !important;
}

/* Prevent parent theme wrappers from clipping fullscreen breakout */
.entry-content, .wp-block-post-content, .site-main, .content-area {
  overflow-x: visible;
}


/* v0.3.1 collapsible panel sections */
.wie-panel-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.wie-panel h4.wie-panel-title {
  margin:0 !important;
  flex:1 1 auto;
  cursor:pointer;
  user-select:none;
}
.wie-panel h4.wie-panel-title:hover {
  color:#151a25;
}
.wie-panel h4.wie-panel-title:focus {
  outline:none;
}
.wie-panel h4.wie-panel-title:focus-visible {
  box-shadow: 0 0 0 3px rgba(124,77,255,.12);
  border-radius:8px;
}
.wie-panel-toggle {
  border:1px solid var(--wie-border);
  background:#fff;
  color:var(--wie-muted);
  border-radius:999px;
  padding:3px 10px;
  font-size:11px;
  font-weight:700;
  line-height:1.2;
  cursor:pointer;
  min-height:26px;
}
.wie-panel-toggle:hover {
  border-color:#cfc7e8;
  color:var(--wie-text);
}
.wie-panel-toggle:focus {
  outline:none;
}
.wie-panel-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(124,77,255,.12);
}
.wie-panel.is-collapsed {
  background: rgba(255,255,255,.28);
}
.wie-panel.is-collapsed .wie-panel-header {
  margin-bottom:0;
}
.wie-panel.is-collapsed .wie-panel-body {
  display:none !important;
}
.wie-panel.is-collapsed h4.wie-panel-title::after {
  content:'(collapsed)';
  margin-left:6px;
  color:#8a8fa0;
  font-size:11px;
  font-weight:600;
}


/* ===== v0.3.2 techy theme polish + true fullscreen visuals ===== */
:root {
  --wie-bg: #090d18;
  --wie-surface: #11182a;
  --wie-surface-2: #161f36;
  --wie-border: #273657;
  --wie-border-2: #1d2944;
  --wie-text: #eaf1ff;
  --wie-muted: #9fb1d9;
  --wie-accent: #6f8cff;
  --wie-accent-soft: rgba(111,140,255,.14);
  --wie-shadow: 0 16px 50px rgba(0,0,0,.35);
}
.wie-editor-wrap{
  background:
    radial-gradient(1200px 500px at 6% -10%, rgba(0,255,208,.08), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(111,140,255,.18), transparent 55%),
    linear-gradient(180deg, #0b101d 0%, #0a0f1b 100%);
  border-color:#223250;
  box-shadow:0 18px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.03);
}
.wie-editor-header{
  background:linear-gradient(180deg, rgba(17,24,42,.96) 0%, rgba(13,18,31,.94) 100%);
  border-bottom-color:#223250;
}
.wie-editor-title{color:#f4f7ff;}
.wie-editor-desc{color:#9cb0d7;}
.wie-editor-toolbar{
  background:linear-gradient(180deg, rgba(12,18,32,.86) 0%, rgba(12,18,32,.72) 100%);
  border-bottom-color:#223250;
}
.wie-editor-left{
  background:linear-gradient(180deg, rgba(12,18,32,.98) 0%, rgba(10,14,25,.98) 100%);
  border-right-color:#223250;
}
.wie-editor-left-scroll{scrollbar-color:#45619c transparent;}
.wie-editor-left-scroll::-webkit-scrollbar-thumb{background:#4b6aac;}
.wie-panel{
  background:linear-gradient(180deg, rgba(255,255,255,.02) 0%, rgba(255,255,255,.01) 100%);
  border:1px solid rgba(111,140,255,.08);
}
.wie-panel:hover{
  border-color:rgba(124,255,240,.22);
  box-shadow: inset 0 0 0 1px rgba(124,255,240,.06), 0 8px 20px rgba(0,0,0,.15);
  background:linear-gradient(180deg, rgba(124,255,240,.03) 0%, rgba(111,140,255,.03) 100%);
}
.wie-panel h4, .wie-panel h4.wie-panel-title{color:#edf3ff;}
.wie-panel h4::before{
  border-color:#345080;
  background:linear-gradient(180deg, #16203a 0%, #111a31 100%);
  box-shadow: inset 0 0 0 2px rgba(111,140,255,.15), 0 0 0 1px rgba(0,0,0,.1);
}
.wie-panel-toggle{
  background:#121a30;
  color:#cfe0ff;
  border-color:#324b78;
}
.wie-panel-toggle:hover{background:#16203a;border-color:#4f73b4;color:#fff;}
.wie-field-row label{color:#b9caee;}
.wie-editor-wrap input[type=number],
.wie-editor-wrap input[type=text],
.wie-editor-wrap select,
.wie-editor-wrap input[type=file]{
  background:#11192c;
  color:#edf2ff;
  border-color:#2a3d64;
}
.wie-editor-wrap input[type=file]{background:#0f1628;}
.wie-editor-wrap input[type=number]:focus,
.wie-editor-wrap input[type=text]:focus,
.wie-editor-wrap select:focus,
.wie-editor-wrap input[type=file]:focus{
  border-color:#6f8cff;
  box-shadow:0 0 0 3px rgba(111,140,255,.18), 0 0 0 1px rgba(111,140,255,.18) inset;
}
.wie-editor-wrap input[type=range]{accent-color:#7cffea;}
.wie-editor-wrap .button,
.wie-editor-wrap .button.button-primary,
.wie-editor-wrap .button-primary{
  background:linear-gradient(180deg, #15203a 0%, #121a30 100%);
  color:#eaf1ff;
  border-color:#2e4470;
}
.wie-editor-wrap .button:hover,
.wie-editor-wrap .button.button-primary:hover,
.wie-editor-wrap .button-primary:hover{
  background:linear-gradient(180deg, #192846 0%, #15203a 100%);
  border-color:#4466a8;
  box-shadow:0 0 0 1px rgba(111,140,255,.15) inset;
}
.wie-editor-wrap .wie-create-blank,
.wie-editor-wrap .wie-download{
  background:linear-gradient(135deg, rgba(124,255,240,.14) 0%, rgba(111,140,255,.18) 100%) !important;
  color:#dffbff !important;
  border-color:rgba(124,255,240,.28) !important;
  box-shadow: inset 0 0 0 1px rgba(124,255,240,.08), 0 8px 24px rgba(19,34,62,.22);
}
.wie-output{background:#10192d;color:#dbe6ff;border-color:#2a3d64;}
.wie-editor-right{background:#0b101c;}
.wie-canvas-stage{
  background:
    radial-gradient(circle at 1px 1px, rgba(159,177,217,.14) 1px, transparent 0) 0 0 / 18px 18px,
    radial-gradient(900px 500px at 85% -10%, rgba(111,140,255,.10), transparent 58%),
    radial-gradient(700px 500px at 0% 100%, rgba(124,255,240,.06), transparent 62%),
    linear-gradient(180deg, #0d1323 0%, #0b101b 100%);
}
.wie-canvas{
  box-shadow:0 18px 52px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.05), 0 0 0 6px rgba(111,140,255,.04);
}
.wie-canvas-help{background:rgba(9,13,24,.82);border-top-color:#223250;color:#9fb1d9;}
.wie-status{color:#7cffea;}
.wie-menu-toggle::before{color:#7cffea;}
.wie-editor-wrap.wie-editor-fullscreen.wie-menu-collapsed .wie-editor-toolbar .wie-menu-toggle{
  background:rgba(13,19,35,.92) !important;
  border-color:#35507f !important;
  color:#eaf2ff !important;
  box-shadow:0 10px 30px rgba(0,0,0,.35), inset 0 0 0 1px rgba(124,255,240,.08) !important;
}
/* When browser fullscreen is active, use the entire viewport exactly */
.wie-editor-wrap.wie-true-fullscreen{
  position:fixed !important;
  inset:0 !important;
  width:100vw !important;
  min-width:100vw !important;
  max-width:100vw !important;
  height:100vh !important;
  min-height:100vh !important;
  max-height:100vh !important;
  margin:0 !important;
  left:auto !important;
  right:auto !important;
  border-radius:0 !important;
  border:0 !important;
  z-index:999999 !important;
}
.wie-editor-wrap.wie-true-fullscreen .wie-editor-fullscreen,
.wie-editor-wrap.wie-true-fullscreen.wie-editor-fullscreen{
  height:100vh !important;
  min-height:100vh !important;
  max-height:100vh !important;
}


/* ===== v0.3.3 polish ===== */
/* Remove bottom helper strip for cleaner app UI */
.wie-canvas-help { display:none !important; }

/* Make collapsed section headings thinner/cleaner */
.wie-panel.is-collapsed {
  padding: 6px 8px !important;
  border-radius: 10px;
}
.wie-panel.is-collapsed .wie-panel-header {
  margin-bottom: 0 !important;
  min-height: 28px;
  gap: 6px;
}
.wie-panel.is-collapsed h4.wie-panel-title {
  font-size: 12px;
  line-height: 1.15;
}
.wie-panel.is-collapsed h4.wie-panel-title::before {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: 0 0 14px;
}
.wie-panel.is-collapsed h4.wie-panel-title::after {
  content: '' !important;
  margin-left: 0 !important;
}
.wie-panel.is-collapsed .wie-panel-toggle {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 10px;
}

/* In true fullscreen focus mode, let canvas stage use every pixel */
.wie-editor-wrap.wie-true-fullscreen.wie-menu-collapsed .wie-canvas-stage {
  padding: 0 !important;
}
.wie-editor-wrap.wie-true-fullscreen.wie-menu-collapsed .wie-editor-toolbar {
  top: 10px !important;
  left: 10px !important;
}


/* ===== v0.3.4 compact collapsed rows + floating tool panel in focus mode ===== */
/* Fix giant empty collapsed cards: use column flex stack, not stretchable grid rows */
.wie-editor-left-scroll{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  align-content:flex-start !important;
  gap:8px !important;
}

/* Truly compact collapsed sections (close to title height) */
.wie-panel.is-collapsed{
  padding:4px 8px !important;
  border-radius:10px !important;
  min-height:0 !important;
}
.wie-panel.is-collapsed .wie-panel-header{
  min-height:24px !important;
  margin:0 !important;
  gap:6px !important;
  align-items:center !important;
}
.wie-panel.is-collapsed h4.wie-panel-title{
  font-size:11px !important;
  line-height:1.05 !important;
  gap:6px !important;
  margin:0 !important;
}
.wie-panel.is-collapsed h4.wie-panel-title::before{
  width:12px !important;
  height:12px !important;
  flex:0 0 12px !important;
  border-radius:4px !important;
}
.wie-panel.is-collapsed .wie-panel-toggle{
  min-height:18px !important;
  height:18px !important;
  padding:0 7px !important;
  line-height:16px !important;
  font-size:9px !important;
  border-radius:999px !important;
}

/* Floating current tool panel over canvas in collapsed/focus mode */
.wie-floating-tool{
  position:absolute;
  top:56px;
  left:16px;
  width:min(420px, calc(100% - 32px));
  max-height:calc(100% - 72px);
  z-index:60;
  border:1px solid #2e4470;
  border-radius:14px;
  background:linear-gradient(180deg, rgba(13,19,35,.98) 0%, rgba(11,16,28,.98) 100%);
  box-shadow:0 18px 46px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.03);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.wie-floating-tool[hidden]{ display:none !important; }
.wie-floating-tool-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:8px 10px;
  border-bottom:1px solid rgba(111,140,255,.15);
  background:linear-gradient(180deg, rgba(19,29,50,.95) 0%, rgba(14,21,38,.92) 100%);
  cursor:move;
  user-select:none;
  touch-action:none;
}
.wie-floating-tool.is-dragging .wie-floating-tool-bar{ cursor:grabbing; }
.wie-floating-tool-title{
  font-size:12px;
  font-weight:700;
  color:#eaf2ff;
}
.wie-floating-tool-actions{ display:flex; align-items:center; gap:6px; }
.wie-floating-tool-close{
  width:24px; height:24px; min-height:24px;
  border-radius:999px;
  border:1px solid #375283;
  background:#111a30;
  color:#d8e6ff;
  font-weight:800;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.wie-floating-tool-close:hover{ background:#16213a; border-color:#4b6cad; color:#fff; }
.wie-floating-tool-close:focus-visible{ outline:none; box-shadow:0 0 0 3px rgba(111,140,255,.22); }
.wie-floating-tool-body{
  overflow:auto;
  padding:10px;
  scrollbar-width:thin;
  scrollbar-color:#45619c transparent;
}
.wie-floating-tool-body::-webkit-scrollbar{ width:10px; }
.wie-floating-tool-body::-webkit-scrollbar-thumb{ background:#4b6aac; border-radius:12px; border:2px solid transparent; background-clip:content-box; }
.wie-panel.wie-in-floating-tool{
  margin:0 !important;
  border-color:rgba(111,140,255,.12) !important;
}
.wie-panel.wie-in-floating-tool .wie-panel-header{ margin-bottom:8px !important; }

/* Focus mode tweaks */
.wie-editor-wrap.wie-menu-collapsed .wie-floating-tool{
  display:flex;
}
.wie-editor-wrap.wie-true-fullscreen.wie-menu-collapsed .wie-floating-tool{
  max-height:calc(100% - 24px);
  top:12px;
  left:12px;
}


/* v0.3.5: drag crop overlay + compact range rows */
.wie-canvas-stage{ position:relative; }
.wie-crop-overlay{
  position:absolute; inset:0; z-index:3; pointer-events:auto; touch-action:none;
}
.wie-crop-overlay:not(.is-active){ cursor:default; }
.wie-crop-overlay .wie-crop-shade{
  position:absolute; inset:0; pointer-events:none; opacity:0; transition:opacity .12s ease;
}
.wie-crop-overlay.is-visible .wie-crop-shade{ opacity:1; }
.wie-crop-overlay .wie-crop-shade::before{
  content:""; position:absolute; inset:0; background:rgba(8,12,22,.26);
  -webkit-mask: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  mask: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-repeat:no-repeat;
  mask-position: 0 0, var(--x,0) var(--y,0);
  mask-size: 100% 100%, var(--w,0) var(--h,0);
}
/* fallback if mask-composite unsupported */
@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .wie-crop-overlay .wie-crop-shade::before{ display:none; }
}
.wie-crop-rect{
  position:absolute; display:none; border:2px solid rgba(122,177,255,.96); border-radius:10px;
  box-shadow:0 0 0 1px rgba(7,16,38,.5), 0 0 0 9999px rgba(8,12,22,.18) inset;
  background:rgba(122,177,255,.08); pointer-events:none;
}
.wie-crop-overlay.is-visible .wie-crop-rect{ display:block; }
.wie-rotate-angle-row,.wie-resize-percent-row{ margin-top:8px; }
.wie-rotate-angle-row .wie-output,.wie-resize-percent-row .wie-output{ margin-top:6px; }


/* v0.3.6 resize percent box + accordion tidy */
.wie-resize-percent-row .wie-input.wie-resize-percent{
  width:100%;
  max-width:140px;
}
.wie-panel-header{
  align-items:center;
}


/* ===== v0.3.7 toolbar split + hover contrast fix ===== */
/* Fix dark hover title text in dark theme */
.wie-panel h4.wie-panel-title:hover{
  color:#eef4ff !important;
}

/* Toolbar actions group */
.wie-toolbar-actions{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.wie-editor-toolbar{
  gap:12px;
}
.wie-fullscreen-toggle{
  white-space:nowrap;
}

/* Menu collapse is now an icon button (separate from Full Screen) */
.wie-menu-toggle.wie-icon-button{
  width:34px;
  min-width:34px;
  height:34px;
  min-height:34px;
  padding:0 !important;
  justify-content:center;
  position:relative;
  font-size:0 !important;
  line-height:0 !important;
}
.wie-menu-toggle.wie-icon-button::before{
  content:"◀" !important;
  margin:0 !important;
  transform:none !important;
  font-size:12px !important;
  color:inherit !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-menu-toggle.wie-icon-button::before{
  content:"▶" !important;
}
.wie-menu-toggle.wie-icon-button::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
}

/* In focus/collapsed mode keep only the menu icon overlay (fullscreen stays available before entering focus) */
.wie-editor-wrap.wie-menu-collapsed .wie-editor-toolbar .wie-toolbar-actions{
  gap:0 !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-toolbar .wie-fullscreen-toggle{
  display:none !important;
}
.wie-editor-wrap.wie-menu-collapsed .wie-editor-toolbar .wie-menu-toggle{
  pointer-events:auto !important;
}

/* v0.3.9 layers: uploaded images as movable objects */
.wie-layer-controls{
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(111,140,255,.14);
}
.wie-layer-selected-label{
  min-height: 32px;
  display:flex;
  align-items:center;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #2a3d64;
  background:#11192c;
  color:#d9e6ff;
  font-size:12px;
  line-height:1.25;
}
.wie-layer-controls .wie-btn-row .button{
  flex:1 1 calc(50% - 4px);
  justify-content:center;
}
.wie-layer-controls .wie-layer-delete{
  flex-basis:100%;
}
.wie-layer-controls .button[disabled]{
  opacity:.55;
  cursor:not-allowed;
}
/* allow stage interactions when crop is not active */
.wie-crop-overlay{ pointer-events:none !important; }
.wie-crop-overlay.is-active{ pointer-events:auto !important; }
/* show move cursor on canvas when editing layers */
.wie-canvas-stage{ cursor:default; }
.wie-canvas-stage:has(canvas){ touch-action:none; }
