:root {
  --bg: #101217;
  --panel: #191d25;
  --panel-2: #202632;
  --panel-3: #2a3140;
  --border: #333b4c;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --accent: #4aa3ff;
  --accent-2: #66d9ef;
  --danger: #ff5c7a;
  --success: #61d394;
  --warning: #ffd166;
  --shadow: 0 14px 50px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow: auto; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { color: var(--text); }
#appShell { position: relative; display: grid; grid-template-columns: 56px 1fr; min-height: 100vh; align-items: stretch; }
#leftToolbar { background: linear-gradient(180deg, #161a22, #11141b); border-right: 1px solid #303747; padding: 5px 4px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; min-height: 100vh; width: 56px; max-width: 56px; }
.brand { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 7px; margin-bottom: 8px; color: #f7f9fc; font-weight: 800; font-size: 11px; letter-spacing: .3px; line-height: 1.05; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #357dff, #70d6ff); box-shadow: 0 7px 18px rgba(74, 163, 255, .35); }
.tool { border: 1px solid transparent; background: rgba(36, 43, 56,0.4);    border-color: rgba(61,70, 88,0.4); min-height: 40px; border-radius: 9px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: .15s ease; color: #cbd2df; padding: 1px 1px; }
.tool span { font-size: 16px ; }
.tool small { font-size: 8px; line-height: 1; text-align: center; letter-spacing: -0.2px; }
.tool:hover { background: #242b38; border-color: #3d4658; }
.tool.active { background: linear-gradient(180deg, #243855, #1f2a3d); border-color: rgba(74,163,255,.65); color: #fff; box-shadow: inset 0 0 0 1px rgba(74,163,255,.08); }
.tool.danger:hover { border-color: rgba(255, 92, 122, .55); color: #fff; }
#workspace { min-width: 0; display: grid; grid-template-rows: 40px auto; min-height: 100vh; }
#topbar { background: rgba(25,29,37,.96); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 8px; gap: 8px; position: sticky; top: 0; z-index: 50; min-height: 40px; height: 40px; }
.context-toolbar { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-height: 40px; overflow: hidden; }
.context-toolbar.empty { color: var(--muted); }

.history-controls { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding-right: 10px; border-right: 1px solid rgba(255,255,255,.08); }
.history-btn { border: 1px solid #3d4658; border-radius: 10px; background: #1d2430; color: #e9edf5; padding: 8px 12px; cursor: pointer; transition: .15s ease; font-size: 12px; font-weight: 700; }
.history-btn:hover:not(:disabled) { background: #303848; border-color: #4aa3ff; }
.history-btn:disabled { opacity: .38; cursor: not-allowed; filter: grayscale(1); }
#canvasPanel { overflow: visible; background: radial-gradient(circle at center, #232838 0, #151820 65%, #0e1015 100%); display: grid; justify-content: start; align-items: start; place-items: start; padding: 10px; min-height: 0; }
#canvasStage { position: relative; flex: 0 0 auto; background: #0d1017; box-shadow: var(--shadow); transform-origin: center center; }
#mockupCanvas, #perspectiveOverlay { position: absolute; inset: 0; width: 100%; height: 100%; }
#perspectiveOverlay { pointer-events: none; display: none; z-index: 20; }
#perspectiveHandles { position: absolute; inset: 0; pointer-events: none; z-index: 30; display: none; }
.perspective-handle { position: absolute; width: 16px; height: 16px; margin-left: -8px; margin-top: -8px; border-radius: 50%; background: #fff; border: 3px solid #4aa3ff; box-shadow: 0 3px 15px rgba(0,0,0,.65); cursor: move; pointer-events: auto; }
.perspective-handle::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #4aa3ff; }
#bottombar { background: rgba(20,24,32,.98); border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 14px 16px 18px; gap: 12px; width: 100%; }
.footer-panel { background: #151a23; border: 1px solid #2f3748; border-radius: 14px; padding: 12px 14px; }
.footer-panel-title { display: block; font-size: 12px; font-weight: 700; color: #cfd6e2; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.footer-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 0; }
.footer-toggle-arrow { display: inline-block; transition: transform .15s ease; font-size: 13px; color: var(--accent); }
.supplier-comments-panel:not(.is-collapsed) .footer-toggle { margin-bottom: 8px; }
.supplier-comments-panel:not(.is-collapsed) .footer-toggle-arrow { transform: rotate(90deg); }
#supplierComments { width: 100%; min-height: 82px; resize: vertical; background: #0f131b; border: 1px solid #394254; color: var(--text); border-radius: 10px; padding: 10px 12px; line-height: 1.45; outline: none; }
#supplierComments[hidden] { display: none; }
#supplierComments:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(74, 163, 255, .14); }
.logo_colors { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px 14px; }
.colorContainer { display: flex; flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 6px; }
.colorDiv { width: 30px; height: 16px; border-radius: 4px; border: solid 1px #ccc; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.colorName { font-size: 14px; color: #ccc; }
.pantone-empty { color: var(--muted); font-size: 13px; margin: 0; }
.primary-btn, .secondary-btn, .mini-btn, .ctx-btn { border: 1px solid #3d4658; border-radius: 8px; background: #232a37; padding: 5px 8px; cursor: pointer; transition: .15s ease; color: #fff; font-size: 11px; line-height: 1.1; }
.primary-btn { background: linear-gradient(180deg, #287ff1, #1760bf); border-color: #4aa3ff; }
.primary-btn:hover { filter: brightness(1.1); }
.secondary-btn:hover, .mini-btn:hover, .ctx-btn:hover { background: #303848; }
.ctx-btn.active { background: #355985; border-color: #63b4ff; }
.ctx-btn.danger { border-color: rgba(255, 92, 122, .45); }
.ctx-btn.danger:hover { background: #402432; }
.ctx-btn.success { border-color: rgba(97, 211, 148, .7); }
.ctx-btn.success:hover { background: #233c31; }
.full { width: 100%; }
.ctx-group { display: flex; align-items: center; gap: 5px; padding: 3px 5px; background: #171c25; border: 1px solid #2a3140; border-radius: 9px; max-height: 36px; overflow: hidden; }
.ctx-group label { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.ctx-group input[type="number"] { width: 58px; }
.ctx-group input[type="range"] { width: 86px; accent-color: var(--accent); }
.ctx-group input, .ctx-group select, .filter-section input, .filter-section select { background: #0f131b; border: 1px solid #394254; color: var(--text); border-radius: 6px; padding: 3px 5px; }
.ctx-group input[type="color"], .filter-section input[type="color"] { padding: 0; width: 28px; height: 22px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 12px; line-height: 1.4; }
.ui-widget.ui-widget-content { background: #161b24; color: var(--text); border: 1px solid #3a4354; box-shadow: var(--shadow); }
.ui-widget-header { background: #222938; color: #fff; border-color: #3a4354; }
.ui-dialog .ui-dialog-titlebar-close { filter: invert(1); }
#filtersDialog { display: none; }
.filters-layout { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr .8fr; gap: 14px; min-width: 920px; }
.filter-section { background: #10141d; border: 1px solid #2f3748; border-radius: 16px; padding: 13px; display: flex; flex-direction: column; gap: 10px; }
.filter-section h3 { margin: 0 0 4px; font-size: 13px; color: #f6f8fb; letter-spacing: .2px; }
.filter-section label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #cfd6e2; font-size: 13px; }
.filter-section input[type="range"] { accent-color: var(--accent); min-width: 160px; }
.range-section label { display: grid; grid-template-columns: 90px 1fr 42px; align-items: center; }
.filter-section hr { width: 100%; border: 0; border-top: 1px solid #2f3748; margin: 4px 0; }
.canvas-container { position: absolute !important; inset: 0; }
.canvas-container canvas { position: absolute !important; inset: 0; }

.hidden-field { display: none !important; }
.pattern-rotate-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.pattern-option { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.pattern-option img { width: 34px; height: 24px; object-fit: cover; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; background: #222; }
.ui-selectmenu-menu .ui-menu.customicons .ui-menu-item-wrapper { padding: 6px 10px; }
.ui-selectmenu-button.ui-button { width: 100%; box-sizing: border-box; background: #20242d; color: #e8ecf3; border-color: #3a414d; }

.pattern-shape-controls { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.pattern-shape-controls label { white-space: nowrap; }
.pattern-shape-controls input[type="range"] { width: 92px; }
.pattern-shape-controls .ctx-btn { white-space: nowrap; }


#wrapMeshStage { position: absolute; inset: 0; display: none; z-index: 26; pointer-events: none; }
#wrapMeshCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wrapmesh-dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-width: 720px; }
.wrapmesh-dialog-grid .checkbox-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrapmesh-dialog-actions { margin-top: 8px; display: flex; gap: 8px; }
.wrapmesh-controls { max-width: 100%; overflow-x: auto; }
.wrapmesh-controls .ctx-group { flex-wrap: wrap; }
.wrapmesh-controls input[type="range"] { width: 110px; }

.font-family-select { min-width: 190px; }
.ui-selectmenu-menu .ui-menu .ui-menu-item-wrapper { line-height: 1.45; }
.ui-selectmenu-button.font-family-select-button, .ui-selectmenu-button.ui-button { max-width: 260px; }
#textFontFamilySelect-button .ui-selectmenu-text { font-size: 14px; }

/* v1.25 top application menu + toolbar below contextual bar */
#mainMenuBar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 30px;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  background: #11151d;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
}
.app-menu-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #357dff, #70d6ff);
  box-shadow: 0 5px 15px rgba(74, 163, 255, .25);
}
.menu-nav {
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.menu-item {
  position: relative;
  display: flex;
  align-items: stretch;
}
.menu-trigger {
  border: 0;
  background: transparent;
  color: #d8deea;
  padding: 0 8px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 6px;
}
.menu-item:hover .menu-trigger,
.menu-item:focus-within .menu-trigger,
.menu-item.is-open .menu-trigger {
  background: #242b38;
  color: #fff;
}
.menu-dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 245px;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: #171c25;
  border: 1px solid #30394b;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 30;
}
.menu-item.is-open .menu-dropdown {
  display: flex;
}
.menu-action,
.menu-check {
  width: 100%;
  border: 0;
  background: transparent;
  color: #e4e9f2;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.menu-action:hover:not(:disabled),
.menu-check:hover:not(.disabled) {
  background: #273042;
}
.menu-action:disabled,
.menu-check.disabled {
  opacity: .42;
  cursor: not-allowed;
}
.menu-note,
.menu-shortcut {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.menu-check {
  justify-content: flex-start;
}
.menu-check input {
  margin: 0;
}
#appShell {
  display: block;
  min-height: calc(100vh - 30px);
}
#workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: 40px auto;
  min-height: calc(100vh - 30px);
}
#topbar {
  top: 30px;
  width: 100%;
  min-height: 40px;
  height: 40px;
}
#workAreaGrid {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: stretch;
  min-height: calc(100vh - 70px);
}
#leftToolbar {
  min-height: auto;
  height: auto;
  overflow-y: auto;
  border-top: 0;
}
#canvasPanel {
  min-height: calc(100vh - 70px);
}
#bottombar {
  margin-left: 0;
}


.filters-layout-two-cols { grid-template-columns: 1fr 1fr; min-width: 860px; }
.filters-col { display: flex; flex-direction: column; gap: 14px; }
.filter-section label span { display: inline-flex; align-items: center; gap: 8px; }
.filter-titlebar-reset { margin-right: 8px; border: 1px solid #3d4658; border-radius: 8px; background: #232a37; color: #fff; padding: 4px 10px; cursor: pointer; font-size: 12px; }
.filter-titlebar-reset:hover { background: #303848; }

/* v1.40 — compact right-side modals */
.ui-dialog { max-width: 340px !important; }
.ui-dialog .ui-dialog-content { max-width: 340px !important; max-height: var(--app-dialog-content-max-height, calc(100vh - 150px)) !important; overflow-y: auto !important; overflow-x: hidden !important; }
#filtersDialog, #wrapMeshDialog { width: 100% !important; box-sizing: border-box; }
.filters-layout, .filters-layout-two-cols, .wrapmesh-dialog-grid { display: grid !important; grid-template-columns: 1fr !important; min-width: 0 !important; width: 100% !important; gap: 12px !important; }
.filters-col { min-width: 0; width: 100%; gap: 12px; }
.filter-section { min-width: 0; padding: 11px; border-radius: 13px; }
.filter-section label { display: grid; grid-template-columns: minmax(84px, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 7px; font-size: 12px; }
.filter-section label > span { grid-column: 1 / -1; }
.filter-section input[type="range"] { min-width: 0; width: 100%; }
.filter-section input[type="color"] { justify-self: start; }
.range-section label { grid-template-columns: minmax(84px, 1fr) minmax(0, 1.2fr) 38px; }
.pattern-rotate-row { gap: 6px; }
.pattern-rotate-row .mini-btn { padding: 7px 9px; font-size: 12px; }
.filter-titlebar-reset { padding: 3px 8px; font-size: 11px; }
.wrapmesh-dialog-grid .filter-section label { grid-template-columns: minmax(86px, 1fr) minmax(0, 1.2fr) 42px; }
.wrapmesh-dialog-grid .checkbox-row { display: flex !important; }

/* v1.41 — modal height limited by #canvasPanel */
.ui-dialog { max-height: var(--app-dialog-max-height, calc(100vh - 120px)) !important; }


/* v1.42 — tighter modal rows and true #canvasPanel-contained dialogs */
.ui-dialog {
  width: min(340px, calc(100vw - 24px)) !important;
  max-width: 340px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
.ui-dialog .ui-dialog-titlebar {
  padding: 6px 8px !important;
  min-height: 30px;
}
.ui-dialog .ui-dialog-content {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 8px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
.filters-layout,
.filters-layout-two-cols,
.wrapmesh-dialog-grid {
  gap: 8px !important;
}
.filters-col {
  gap: 8px !important;
}
.filter-section {
  padding: 8px !important;
  border-radius: 10px !important;
  gap: 7px !important;
}
.filter-section h3 {
  margin: 0 0 2px !important;
  font-size: 12px !important;
}
.filter-section label,
.range-section label,
.wrapmesh-dialog-grid .filter-section label {
  display: grid !important;
  grid-template-columns: minmax(72px, 86px) minmax(112px, 1fr) minmax(30px, 36px) !important;
  align-items: center !important;
  gap: 5px !important;
  min-height: 24px !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}
.filter-section label > span:not([data-value-for]) {
  grid-column: 1 / -1;
}
.filter-section label > span[data-value-for] {
  grid-column: auto !important;
  justify-self: end !important;
  white-space: nowrap !important;
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.filter-section input[type="range"] {
  min-width: 0 !important;
  width: 100% !important;
  height: 20px;
}
.filter-section input[type="color"] {
  width: 30px !important;
  height: 24px !important;
}
.filter-section select,
.filter-section input:not([type="range"]):not([type="checkbox"]):not([type="color"]) {
  min-width: 0 !important;
  width: 100% !important;
  padding: 4px 5px !important;
  font-size: 11px !important;
}
.pattern-rotate-row {
  margin: 4px 0 !important;
  gap: 5px !important;
}
.pattern-rotate-row .mini-btn,
.filter-titlebar-reset,
.wrapmesh-dialog-actions .secondary-btn {
  padding: 5px 7px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
}
.wrapmesh-dialog-actions {
  margin-top: 4px !important;
}
.wrapmesh-dialog-grid .checkbox-row {
  display: flex !important;
  min-height: 24px !important;
}


/* v1.43 — filter title checkbox layout + removed unused basic effects */
.filter-section h3.filter-title-check {
  margin: 0 0 5px !important;
}
.filter-section h3.filter-title-check label {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  min-height: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #f6f8fb !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  cursor: pointer;
}
.filter-section h3.filter-title-check input[type="checkbox"] {
  margin: 0 !important;
  width: 13px !important;
  height: 13px !important;
  flex: 0 0 auto;
}


/* v1.44 — wrap-around mesh modal: compact rows without layout conflicts */
#wrapMeshDialog {
  max-width: 100% !important;
  box-sizing: border-box !important;
}
#wrapMeshDialog .wrapmesh-dialog-grid {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  gap: 8px !important;
  overflow: visible !important;
}
#wrapMeshDialog .filter-section {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 8px !important;
  gap: 6px !important;
}
#wrapMeshDialog .filter-section h3 {
  margin: 0 0 4px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
}
#wrapMeshDialog .filter-section label:not(.checkbox-row) {
  display: grid !important;
  grid-template-columns: 76px minmax(92px, 1fr) 42px !important;
  align-items: center !important;
  gap: 5px !important;
  min-height: 22px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
#wrapMeshDialog .filter-section label:not(.checkbox-row) > span {
  grid-column: auto !important;
  justify-self: end !important;
  white-space: nowrap !important;
  text-align: right !important;
  font-size: 11px !important;
  font-variant-numeric: tabular-nums !important;
  min-width: 0 !important;
}
#wrapMeshDialog .filter-section input[type="range"] {
  width: 100% !important;
  min-width: 0 !important;
  height: 18px !important;
  margin: 0 !important;
}
#wrapMeshDialog .checkbox-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-height: 22px !important;
  width: 100% !important;
  font-size: 11px !important;
}
#wrapMeshDialog .checkbox-row > span {
  grid-column: auto !important;
  white-space: nowrap !important;
}
#wrapMeshDialog .wrapmesh-dialog-actions {
  margin-top: 4px !important;
}
#wrapMeshDialog .wrapmesh-dialog-actions .secondary-btn {
  width: 100% !important;
  padding: 5px 7px !important;
  font-size: 11px !important;
}

/* v1.45 — responsive app dialogs, especially wrap-around mesh */
.ui-dialog {
  box-sizing: border-box !important;
  max-width: calc(100vw - 20px) !important;
}
.ui-dialog .ui-dialog-content {
  box-sizing: border-box !important;
  max-width: 100% !important;
}
.app-dialog-wrapmesh,
.app-dialog-wrapmesh .ui-dialog-content,
#wrapMeshDialog {
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}
.app-dialog-wrapmesh .ui-dialog-titlebar {
  box-sizing: border-box !important;
}




/* v1.46 — desktop/widget layout: no responsive blocks, canvas aligned top-left */
#canvasPanel { justify-content: start; align-items: start; place-items: start; padding: 10px; }


/* v1.48 — minimal chrome: 30px menu, 40px context, 56px toolbar */
#mainMenuBar { height: 30px !important; min-height: 30px !important; padding: 0 8px !important; gap: 8px !important; }
.app-menu-icon { width: 20px !important; height: 20px !important; font-size: 11px !important; border-radius: 6px !important; }
.menu-trigger { min-height: 24px !important; padding: 0 8px !important; font-size: 12px !important; border-radius: 6px !important; }
.menu-nav { gap: 1px !important; }
#appShell { min-height: 400px !important; }
#workspace { grid-template-rows: 40px auto !important; min-height: 400px !important;  }
#topbar { top: 30px !important; height: 40px !important; min-height: 40px !important; padding: 0 8px !important; gap: 8px !important; }
#workAreaGrid { grid-template-columns: 56px 1fr !important; min-height: 400px !important;  }
#leftToolbar { width: 56px !important; max-width: 56px !important; min-width: 56px !important; padding: 5px 4px !important; gap: 3px !important; overflow-x: hidden !important; }
.tool { min-height: 40px !important; padding: 1px 1px !important; gap: 1px !important; border-radius: 8px !important; }
.tool span { font-size: 16px ; }
.tool small { font-size: 8px !important; line-height: 1 !important; letter-spacing: -0.2px !important; }
#canvasPanel { min-height: 400px !important;  }
.context-toolbar { max-height: 40px !important; gap: 6px !important; overflow: hidden !important; }
.ctx-group { max-height: 36px !important; padding: 3px 5px !important; gap: 5px !important; border-radius: 9px !important; }
.ctx-group label { font-size: 10px !important; gap: 4px !important; white-space: nowrap !important; }
.ctx-group input[type="number"] { width: 58px !important; }
.ctx-group input[type="range"] { width: 86px !important; }
.ctx-group input, .ctx-group select { padding: 3px 5px !important; border-radius: 6px !important; font-size: 11px !important; }
.ctx-group input[type="color"] { width: 28px !important; height: 22px !important; }
.ctx-btn, .mini-btn, .secondary-btn, .primary-btn { padding: 5px 8px !important; font-size: 11px !important; border-radius: 8px !important; line-height: 1.1 !important; }
.pattern-shape-controls input[type="range"], .wrapmesh-controls input[type="range"] { width: 76px !important; }
.font-family-select { min-width: 145px !important; }


.text-options-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.text-options-body .filter-section {
  padding: 8px;
  gap: 7px;
}

.text-options-body label {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.text-options-body input,
.text-options-body select {
  min-width: 0;
}

.text-options-body .text-toggle-row,
.text-options-body .text-action-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.text-options-body .ctx-btn {
  padding: 6px 9px;
  min-height: 28px;
  font-size: 12px;
}

.text-options-body .font-family-select {
  width: 100%;
}


/* v1.56 — compact text modal, font menu overflow fix, filter reset titlebar alignment */
#textOptionsDialog {
  width: 100% !important;
  box-sizing: border-box !important;
}

.app-dialog-text,
#textOptionsDialog.ui-dialog-content {
  max-width: 240px !important;
}

.text-options-body {
  gap: 5px !important;
}

.text-options-body .filter-section {
  padding: 7px !important;
  gap: 6px !important;
}

.text-options-body label {
  display: grid !important;
  grid-template-columns: 68px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 5px !important;
  min-height: 23px !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}

.text-options-body .text-toggle-row {
  gap: 5px !important;
}

.text-options-body .ctx-btn {
  padding: 5px 8px !important;
  min-height: 26px !important;
  font-size: 11px !important;
}

#textFontFamilySelect-button {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.ui-selectmenu-menu {
  z-index: 10050 !important;
}

.ui-selectmenu-menu .ui-menu {
  max-height: 260px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.ui-dialog .ui-dialog-titlebar {
  position: relative !important;
  padding-right: 112px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

.ui-dialog .ui-dialog-title {
  display: block !important;
  max-width: calc(100% - 4px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  margin-right: 0 !important;
}

.ui-dialog .ui-dialog-titlebar-close {
  position: absolute !important;
  right: 7px !important;
  top: 50% !important;
  margin-top: -10px !important;
}

.filter-titlebar-reset {
  position: absolute !important;
  right: 34px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  height: 21px !important;
  line-height: 1 !important;
  padding: 3px 7px !important;
  font-size: 10.5px !important;
  white-space: nowrap !important;
}


/* v1.57 — keep Font family dropdown above text modal and avoid scroll drift */
.text-font-selectmenu-menu,
.ui-selectmenu-menu.text-font-selectmenu-menu {
  z-index: 20000 !important;
}

.text-font-selectmenu-menu .ui-menu {
  max-height: 260px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#textFontFamilySelect-button {
  z-index: 1 !important;
}


/* v1.58 — logo preparation module + logo asset strip */
#workAreaGrid {
  grid-template-columns: 56px 1fr !important;
  grid-template-rows: 24px auto !important;
}

#workAreaGrid.logo-panel-expanded {
  grid-template-rows: 64px auto !important;
}

#leftToolbar {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
}

#logoAssetPanel {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0;
  height: 64px;
  background: rgba(18, 22, 30, .96);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  overflow: hidden;
  transition: height .18s ease;
}

#logoAssetPanel.is-collapsed {
  height: 24px;
  padding-top: 0;
  padding-bottom: 0;
}

.logo-assets-head {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  min-width: max-content;
  min-height: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  margin: 0;
  padding: 0 5px;
  cursor: pointer;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(74,163,255,.65);
  text-align: left;
}

.logo-assets-head:hover {
  color: rgba(125,190,255,.95);
  text-decoration: underline;
}

.logo-assets-title {
  line-height: 1;
}

.logo-assets-chevron {
  line-height: 1;
  font-size: 12px;
  transform: translateY(-1px);
}

.logo-asset-list {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  height: 52px;
}

#logoAssetPanel.is-collapsed .logo-asset-list {
  display: none;
}

.logo-asset-card {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 1px solid #313a4c;
  border-radius: 10px;
  background: #10141d;
  display: grid;
  place-items: center;
  padding: 3px;
  cursor: pointer;
  position: relative;
}

.logo-asset-card:hover {
  border-color: #4aa3ff;
  background: #182033;
}

.logo-asset-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.logo-asset-card.is-prepared::after {
  content: '';
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  background: #32d583;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #0b111b;
}

.logo-asset-card.is-unprepared::after {
  content: '';
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  background: #fdb022;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #0b111b;
}

#canvasPanel {
  grid-column: 2 !important;
  grid-row: 2 !important;
  min-height: calc(100vh - 134px) !important;
}

#logoPrepEditorDialog {
  width: 100% !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#logoPrepFrame {
  width: 100%;
  height: min(78vh, 720px);
  border: 0;
  display: block;
  background: #11151d;
}

.app-dialog-logo-prep {
  max-width: min(1120px, calc(100vw - 32px)) !important;
  width: min(1120px, calc(100vw - 32px)) !important;
}

.app-dialog-logo-prep .ui-dialog-content {
  max-width: none !important;
  padding: 0 !important;
  overflow: hidden !important;
}


/* v1.59 — inline logo preparation modal, no iframe */
.inline-logo-prep {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #11151d;
  color: var(--text);
  min-width: 0;
}

.inline-logo-prep-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 8px;
  background: #10141d;
  border-bottom: 1px solid var(--border);
}

.inline-logo-prep-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #cfd6e2;
}

.inline-logo-prep-toolbar input[type="range"] {
  width: 90px;
}

.inline-logo-prep-preview {
  height: 500px;
  min-height: 360px;
  display: grid;
  place-items: center;
  background: #ffffff;
  overflow: hidden;
  margin: 0 8px;
  border-radius: 10px;
  border: 1px solid #2f3748;
}

.inline-logo-prep-preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.inline-logo-prep-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--border);
}

.app-dialog-logo-prep {
  max-width: min(980px, calc(100vw - 32px)) !important;
  width: min(980px, calc(100vw - 32px)) !important;
}

.app-dialog-logo-prep .ui-dialog-content,
#logoPrepEditorDialog {
  max-width: none !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.cropper-container {
  max-width: 100%;
}



/* v1.60 — improved inline logo-prep controls */
.inline-logo-prep {
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.inline-logo-prep-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
}

.inline-logo-prep-colors {
  margin: 0 8px;
  padding: 8px;
  background: #10141d;
  border: 1px solid #2f3748;
  border-radius: 10px;
}

.inline-logo-prep-colors-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 12px;
  color: #f6f8fb;
}

.inline-logo-prep-colors-title small {
  color: var(--muted);
  font-size: 10px;
}

.inline-logo-prep-color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.inline-logo-prep-color-card {
  border: 1px solid #30384a;
  border-radius: 10px;
  background: #151b27;
  padding: 6px;
  display: grid;
  grid-template-columns: 22px 76px;
  grid-template-rows: auto auto;
  gap: 5px;
  align-items: center;
}

.inline-logo-prep-color-card.is-selected {
  border-color: #4aa3ff;
}

.inline-logo-prep-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.35);
}

.inline-logo-prep-color-card input[type="color"] {
  width: 76px;
  height: 24px;
}

.inline-logo-prep-color-card label {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #cfd6e2;
  font-size: 10px;
}

.inline-logo-prep-preview {
  touch-action: auto;
}

.inline-logo-prep-preview .cropper-container {
  direction: ltr;
}



/* v1.61 — logo-prep closer to original palette UX + checkerboard transparency */
.inline-logo-prep-preview {
  background-color: #fff !important;
  background-image:
    linear-gradient(45deg, #d9dee7 25%, transparent 25%),
    linear-gradient(-45deg, #d9dee7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9dee7 75%),
    linear-gradient(-45deg, transparent 75%, #d9dee7 75%) !important;
  background-size: 18px 18px !important;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0 !important;
}

.inline-logo-prep-color-card {
  appearance: none;
  cursor: pointer;
  grid-template-columns: 26px 72px !important;
  grid-template-rows: auto auto !important;
  text-align: left;
}

.inline-logo-prep-color-card .inline-logo-prep-color-name {
  font-size: 10px;
  color: #cfd6e2;
  font-variant-numeric: tabular-nums;
}

.inline-logo-prep-color-card.is-selected {
  border-color: #4aa3ff !important;
  box-shadow: 0 0 0 1px rgba(74,163,255,.35);
}

.inline-logo-prep-color-card.is-selected::after {
  content: '\\2713';
  position: absolute;
  right: 5px;
  top: 4px;
  color: #4aa3ff;
  font-size: 12px;
  font-weight: 800;
}

.inline-logo-prep-color-card {
  position: relative;
}

.inline-logo-prep-color-card input[type="color"] {
  grid-column: 1 / -1;
  width: 100% !important;
}

.inline-logo-prep .cropper-bg {
  background-image:
    linear-gradient(45deg, #d9dee7 25%, transparent 25%),
    linear-gradient(-45deg, #d9dee7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9dee7 75%),
    linear-gradient(-45deg, transparent 75%, #d9dee7 75%) !important;
  background-size: 18px 18px !important;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0 !important;
}

.logo-asset-list .muted {
  color: var(--muted);
  font-size: 11px;
}


/* v1.62 — logo-prep modal matches original tool more closely */
#logoPrepEditorDialog .logo-prep-dialog-inner {
  padding: 10px;
  background: #1d1d1d;
  color: #eee;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}

#logoPrepEditorDialog .logo-prep-stage {
  width: 750px;
  height: 440px;
  max-width: 100%;
  margin: 0 auto;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, rgba(221,221,221,.9) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(221,221,221,.9) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(221,221,221,.9) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(221,221,221,.9) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #ccc;
  border-radius: 8px;
}

#inlineLogoPrepImage {
  display: block;
  max-width: 100%;
}

#logoPrepEditorDialog .logo-prep-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #3e4652;
  border-radius: 8px;
  background: #222831;
  color: #eef2f6;
}

#logoPrepEditorDialog .logo-prep-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  min-height: 34px;
  font-size: 13px;
}

#logoPrepEditorDialog #inlineLogoPrepBgColor {
  width: 42px;
  height: 30px;
  padding: 0;
  border: 1px solid #bbb;
  border-radius: 5px;
  background: #fff;
}

#logoPrepEditorDialog #inlineLogoPrepThreshold {
  width: 130px;
}

#logoPrepEditorDialog #inlineLogoPrepThresholdVal {
  min-width: 32px;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

#logoPrepEditorDialog .logo-prep-preview-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

#logoPrepEditorDialog .logo-prep-rotate-actions {
  grid-column: 2;
  display: inline-flex;
  justify-content: center;
  gap: 8px;
}

#logoPrepEditorDialog .logo-prep-crop-action {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
}

#logoPrepEditorDialog .logo-prep-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#logoPrepEditorDialog button {
  cursor: pointer;
  border: 1px solid #49515c;
  background: #2a3038;
  color: #f2f2f2;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
}

#logoPrepEditorDialog button:hover {
  background: #343b45;
}

#logoPrepEditorDialog button.primary {
  background: #1b74e4;
  color: #fff;
  border-color: #1b74e4;
}

#logoPrepEditorDialog button.primary:hover {
  background: #155fc0;
}

#logoPrepEditorDialog button:disabled,
#logoPrepEditorDialog input:disabled {
  opacity: .55;
  cursor: not-allowed;
}

#logoPrepEditorDialog .dominant-colors-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #3e4652;
  border-radius: 8px;
  background: #222831;
  color: #eef2f6;
}

#logoPrepEditorDialog .dominant-colors-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#logoPrepEditorDialog .dominant-colors-title {
  font-weight: bold;
  font-size: 14px;
}

#logoPrepEditorDialog .dominant-colors-hint {
  color: #aaa;
  font-size: 12px;
  margin-top: 6px;
}

#logoPrepEditorDialog .color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#logoPrepEditorDialog .color-chip {
  width: 132px;
  border: 1px solid #ddd;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  color: #222;
  font-size: 11px;
  line-height: 1.25;
  position: relative;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

#logoPrepEditorDialog .color-chip:hover {
  border-color: #999;
}

#logoPrepEditorDialog .color-chip.is-selected {
  border-color: #1b74e4;
  box-shadow: 0 0 0 2px rgba(27, 116, 228, .18);
}

#logoPrepEditorDialog .color-chip.is-selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  background: #1b74e4;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

#logoPrepEditorDialog .color-chip-swatch {
  height: 30px;
  border-bottom: 1px solid #ddd;
}

#logoPrepEditorDialog .color-chip-swatch.pantone-swatch {
  height: 22px;
  border-top: 1px solid #eee;
}

#logoPrepEditorDialog .color-chip-label {
  padding: 5px 6px;
  text-align: center;
  font-family: Consolas, Monaco, monospace;
  word-break: break-word;
}

#logoPrepEditorDialog .color-chip-pantone-name {
  padding: 5px 6px;
  text-align: center;
  font-size: 10px;
  color: #333;
  min-height: 28px;
}

#logoPrepEditorDialog #showMoreColors {
  padding: 5px 9px;
  font-size: 12px;
}

#logoPrepEditorDialog .hidden {
  display: none !important;
}

/* cropper closer to original */
#logoPrepEditorDialog .cropper-point {
  width: 22px !important;
  height: 22px !important;
  opacity: .92 !important;
}

#logoPrepEditorDialog .cropper-point.point-n { top: -11px !important; margin-left: -11px !important; }
#logoPrepEditorDialog .cropper-point.point-s { bottom: -11px !important; margin-left: -11px !important; }
#logoPrepEditorDialog .cropper-point.point-e { right: -11px !important; margin-top: -11px !important; }
#logoPrepEditorDialog .cropper-point.point-w { left: -11px !important; margin-top: -11px !important; }
#logoPrepEditorDialog .cropper-point.point-ne { top: -11px !important; right: -11px !important; }
#logoPrepEditorDialog .cropper-point.point-nw { top: -11px !important; left: -11px !important; }
#logoPrepEditorDialog .cropper-point.point-se { right: -11px !important; bottom: -11px !important; }
#logoPrepEditorDialog .cropper-point.point-sw { left: -11px !important; bottom: -11px !important; }
#logoPrepEditorDialog .cropper-line.line-e,
#logoPrepEditorDialog .cropper-line.line-w { width: 12px !important; }
#logoPrepEditorDialog .cropper-line.line-n,
#logoPrepEditorDialog .cropper-line.line-s { height: 12px !important; }

#logoPrepEditorDialog .cropper-view-box {
  outline: 1px solid rgba(255, 255, 255, 0.95) !important;
  box-shadow: none !important;
  background: transparent !important;
}

#logoPrepEditorDialog .cropper-face {
  background: transparent !important;
  opacity: 0 !important;
}

#logoPrepEditorDialog .cropper-dashed {
  display: block !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
}

#logoPrepEditorDialog .cropper-center {
  display: block !important;
}

#logoPrepEditorDialog .cropper-center::before,
#logoPrepEditorDialog .cropper-center::after {
  background-color: rgba(255, 255, 255, 0.8) !important;
}

#logoPrepEditorDialog .cropper-line {
  background-color: transparent !important;
  opacity: 0 !important;
}

#logoPrepEditorDialog .cropper-point {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(0, 0, 0, 0.65) !important;
  opacity: 1 !important;
}

#logoPrepEditorDialog .cropper-modal {
  background-color: #000 !important;
  opacity: 0.34 !important;
}

#logoPrepEditorDialog .cropper-bg,
#logoPrepEditorDialog .cropper-container,
#logoPrepEditorDialog .cropper-wrap-box,
#logoPrepEditorDialog .cropper-canvas {
  background-color: transparent !important;
}



/* v1.63 — logo-prep modal adaptive height and 750x360 preview */
.app-dialog-logo-prep {
  width: 800px !important;
  max-width: 800px !important;
  height: auto !important;
  max-height: none !important;
}

.app-dialog-logo-prep .ui-dialog-content,
#logoPrepEditorDialog {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

#logoPrepEditorDialog .logo-prep-dialog-inner,
#logoPrepEditorDialog .inline-logo-prep {
  max-height: none !important;
  overflow: visible !important;
}

#logoPrepEditorDialog .logo-prep-stage {
  width: 750px !important;
  height: 360px !important;
}

#logoPrepEditorDialog .logo-prep-footer {
  position: static !important;
}


/* v1.65 — logo-prep loading state for PDF/AI/EPS conversion */
#logoPrepEditorDialog .logo-prep-stage.is-loading {
  position: relative;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading::after {
  content: attr(data-loading-text);
  color: #d9e2f2;
  background: rgba(17, 21, 29, .86);
  border: 1px solid #3e4652;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}


/* v1.76 — smoother logo-prep loading/rendering */
#logoPrepEditorDialog .logo-prep-stage.is-loading,
#logoPrepEditorDialog .logo-prep-stage.is-rendering {
  position: relative;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading #inlineLogoPrepImage,
#logoPrepEditorDialog .logo-prep-stage.is-rendering #inlineLogoPrepImage {
  visibility: hidden !important;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading::after,
#logoPrepEditorDialog .logo-prep-stage.is-rendering::after {
  content: attr(data-loading-text);
  min-width: 220px;
  text-align: center;
  color: #d9e2f2;
  background: rgba(17, 21, 29, .88);
  border: 1px solid #3e4652;
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}

#logoPrepEditorDialog .logo-prep-stage.is-rendering::after {
  content: "Ajustando preview...";
}


/* v1.79 — stable logo-prep loader overlay, no cropper layout conflict */
#logoPrepEditorDialog .logo-prep-stage {
  position: relative !important;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading,
#logoPrepEditorDialog .logo-prep-stage.is-rendering {
  position: relative !important;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading::after,
#logoPrepEditorDialog .logo-prep-stage.is-rendering::after {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 80 !important;
  display: block !important;
  box-sizing: border-box !important;
  width: auto !important;
  max-width: calc(100% - 40px) !important;
  pointer-events: none !important;
  white-space: nowrap !important;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading .cropper-container,
#logoPrepEditorDialog .logo-prep-stage.is-rendering .cropper-container {
  visibility: hidden !important;
  pointer-events: none !important;
}


/* v1.81 — related logo file-type tiles */
.logo-asset-filetype {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  background: #101827;
  border: 1px solid #334155;
  color: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}


/* v1.86 — user-visible error dialog */
.app-error-dialog-body {
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1.45;
}

.app-error-dialog-body p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}


/* v1.88 — dark jQuery UI error dialog */
.app-dialog-error {
  background: #11151d !important;
  border: 1px solid #2f3748 !important;
  color: #e5e7eb !important;
  border-radius: 12px !important;
  overflow: hidden;
}

.app-dialog-error .ui-dialog-titlebar {
  background: #151b27 !important;
  color: #f8fafc !important;
  border: 0 !important;
  border-bottom: 1px solid #2f3748 !important;
  border-radius: 0 !important;
}

.app-dialog-error .ui-dialog-content {
  background: #11151d !important;
  color: #e5e7eb !important;
  padding: 14px 16px !important;
}

.app-dialog-error .ui-dialog-buttonpane {
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 0 !important;
  border-top: 1px solid #2f3748 !important;
  background: #151b27 !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

.app-dialog-error .ui-dialog-buttonset {
  float: none !important;
  display: flex !important;
  gap: 8px !important;
}

.app-dialog-error .ui-dialog-buttonpane button {
  margin: 0 !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  border: 1px solid #3b82f6 !important;
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 12px !important;
  cursor: pointer !important;
}

.app-dialog-error .ui-dialog-buttonpane button:hover {
  background: #1d4ed8 !important;
}


/* v1.91 — compact Pantone panel in one line */
.pantone-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.pantone-panel .footer-panel-title {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

.pantone-panel .logo_colors {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.pantone-panel .colorContainer {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.pantone-panel .pantone-empty {
  margin: 0;
}


/* v1.92 — Attach design footer button */
.attach-design-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0 0;
}

.attach-design-btn {
  min-width: 220px;
  min-height: 42px;
  border: 1px solid #4aa3ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #287ff1, #1760bf);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(23, 96, 191, .22);
  transition: filter .15s ease, transform .15s ease, opacity .15s ease;
}

.attach-design-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.attach-design-btn:active {
  transform: translateY(0);
}

.attach-design-btn:disabled {
  opacity: .72;
  cursor: wait;
  transform: none;
}


/* v1.93 — logo-prep preview processing spinner */
#logoPrepEditorDialog .logo-prep-stage.is-loading #inlineLogoPrepImage,
#logoPrepEditorDialog .logo-prep-stage.is-rendering #inlineLogoPrepImage {
  visibility: visible !important;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading .cropper-container,
#logoPrepEditorDialog .logo-prep-stage.is-rendering .cropper-container {
  visibility: visible !important;
  pointer-events: none !important;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading::before,
#logoPrepEditorDialog .logo-prep-stage.is-rendering::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 79 !important;
  background: rgba(17, 21, 29, .18) !important;
  pointer-events: none !important;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading::after,
#logoPrepEditorDialog .logo-prep-stage.is-rendering::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 3px solid rgba(74, 163, 255, .28) !important;
  border-top-color: #4aa3ff !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: translate(-50%, -50%) !important;
  z-index: 80 !important;
  animation: logoPrepSpinner .75s linear infinite !important;
  pointer-events: none !important;
}

@keyframes logoPrepSpinner {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}


/* v1.94 — larger spinner and stable cropper during preview rebuild */
#logoPrepEditorDialog .logo-prep-stage.is-loading::after,
#logoPrepEditorDialog .logo-prep-stage.is-rendering::after {
  width: 68px !important;
  height: 68px !important;
  border-width: 5px !important;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading .cropper-crop-box,
#logoPrepEditorDialog .logo-prep-stage.is-loading .cropper-face,
#logoPrepEditorDialog .logo-prep-stage.is-loading .cropper-line,
#logoPrepEditorDialog .logo-prep-stage.is-loading .cropper-point,
#logoPrepEditorDialog .logo-prep-stage.is-loading .cropper-view-box,
#logoPrepEditorDialog .logo-prep-stage.is-rendering .cropper-crop-box,
#logoPrepEditorDialog .logo-prep-stage.is-rendering .cropper-face,
#logoPrepEditorDialog .logo-prep-stage.is-rendering .cropper-line,
#logoPrepEditorDialog .logo-prep-stage.is-rendering .cropper-point,
#logoPrepEditorDialog .logo-prep-stage.is-rendering .cropper-view-box {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

#logoPrepEditorDialog .logo-prep-stage.is-loading .cropper-container,
#logoPrepEditorDialog .logo-prep-stage.is-rendering .cropper-container {
  pointer-events: none !important;
}


/* v1.97 — Filters modal refinements */
.filters-layout-one-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.filters-layout-one-col .filter-section {
  width: 100% !important;
  box-sizing: border-box !important;
}

.filter-pattern-selectmenu-menu,
.ui-selectmenu-menu.filter-pattern-selectmenu-menu,
.filter-pattern-selectmenu-menu.ui-selectmenu-open {
  z-index: 31000 !important;
}

.filter-pattern-selectmenu-menu .ui-menu {
  max-height: 280px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#blendPatternSelect-button {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}


/* v1.98 — contextual confirm/cancel icon buttons */
.context-toolbar {
  position: relative;
}

.ctx-inline-hint {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 11px;
  padding-left: 4px;
}

.ctx-confirm-actions {
  margin-left: auto;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 36px;
  flex: 0 0 auto;
}

.ctx-icon-action {
  font-weight: 700 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 9px !important;
  background: #171c25 !important;
  box-sizing: border-box !important;
}

.ctx-cancel-action {
  padding: 0 16px !important;
  color: rgb(255 106 133 / 70%) !important;
  border-color: rgba(255, 106, 133, .38) !important;
}

.ctx-confirm-action {
  padding: 0 32px !important;
  color: rgba(97, 211, 148, .7) !important;
  border-color: rgba(97, 211, 148, .38) !important;
}

.ctx-cancel-action:hover {
  color: rgb(255 106 133 / 78%) !important;
  background: #281b24 !important;
}

.ctx-confirm-action:hover {
  color: rgba(97, 211, 148, .78) !important;
  background: #1b2a24 !important;
}


/* v2.03 — contextual bounding-box sizes and Print size status */
.ctx-opacity-panel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  flex: 0 0 auto;
  order: 0;
}

.ctx-opacity-panel label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.ctx-opacity-panel input[type="range"] {
  width: 135px;
  accent-color: var(--accent);
}

.ctx-dimensions-panel {
  margin-left: auto;
  margin-right: 0;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
  overflow: visible;
  order: 80;
}

.ctx-dimensions-panel input[type="text"] {
  width: 45px;
  height: 24px;
  box-sizing: border-box;
  padding: 2px 5px;
  border: 1px solid #394254;
  border-radius: 6px;
  background: #0f131b;
  color: var(--text);
  font-size: 11px;
  text-align: center;
  appearance: textfield;
}

.ctx-dim-title,
.ctx-print-title {
  color: #d7e3f4;
  font-weight: 600;
  margin-left: 4px;
}

.ctx-dim-unit,
.ctx-dim-x,
.ctx-dim-sep {
  color: var(--muted);
}

.ctx-print-size-panel {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 36px;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
  order: 90;
  margin-left: 10px;
  margin-right: 6px;
}

.ctx-print-size-panel[hidden] {
  display: none !important;
}

.ctx-print-size-value {
  display: inline-block;
  min-width: 96px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #aeb8c8;
}

.context-toolbar.empty {
  display: flex !important;
  align-items: center !important;
}

.context-toolbar.empty .ctx-print-size-panel {
  margin-left: auto !important;
}


/* v2.05 — fixed opacity percentage width */
[data-ctx="opacityVal"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: 27px !important;
  min-width: 27px !important;
  max-width: 27px !important;
  font-variant-numeric: tabular-nums !important;
  text-align: right !important;
}


/* v2.09 — logo assets moved from top strip to hover sidebar menu */
#workAreaGrid {
  grid-template-columns: 56px 1fr !important;
  grid-template-rows: auto !important;
  min-height: 400px !important; 
}

#workAreaGrid.logo-panel-expanded {
  grid-template-rows: auto !important;
}

#leftToolbar {
  grid-column: 1 !important;
  grid-row: 1 !important;
  position: relative !important;
  overflow: visible !important;
  z-index: 80 !important;
}

#canvasPanel {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-height: 400px !important; 
}

#logoAssetPanel {
  display: none !important;
}

.logo-tool-wrap {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
}

.logo-tool-wrap > .tool {
  width: 100%;
}

.logo-sidebar-menu {
  position: absolute;
  left: calc(100% + 6px);
  top: 0;
  width: 260px;
  max-height: min(520px, calc(100vh - 92px));
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid #313a4c;
  border-radius: 12px;
  background: rgba(16, 20, 29, .98);
  box-shadow: 0 16px 42px rgba(0,0,0,.45);
  overflow: hidden;
  z-index: 15000;
}

.logo-tool-wrap.has-logo-assets:hover .logo-sidebar-menu,
.logo-tool-wrap.has-logo-assets:focus-within .logo-sidebar-menu {
  display: flex;
}

.logo-sidebar-menu-title {
  flex: 0 0 auto;
  padding: 2px 4px 7px;
  color: rgba(74,163,255,.85);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.logo-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.logo-sidebar-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px 6px;
}

.logo-sidebar-row.logo-asset-card {
  width: 100%;
  height: 44px;
  min-height: 44px;
  display: grid;
  grid-template-columns: 38px 1fr 12px;
  align-items: center;
  gap: 9px;
  padding: 4px 7px;
  border: 1px solid #313a4c;
  border-radius: 10px;
  background: #10141d;
  cursor: pointer;
  text-align: left;
  position: relative;
}

.logo-sidebar-row.logo-asset-card:hover {
  border-color: #4aa3ff;
  background: #182033;
}

.logo-sidebar-thumb {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.09);
  background: #0b1018;
  overflow: hidden;
}

.logo-sidebar-thumb.is-png {
  background-color: #f8fafc;
  background-image:
    linear-gradient(45deg, #d7dbe3 25%, transparent 25%),
    linear-gradient(-45deg, #d7dbe3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7dbe3 75%),
    linear-gradient(-45deg, transparent 75%, #d7dbe3 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}

.logo-sidebar-thumb img {
  max-width: 30px;
  max-height: 30px;
  object-fit: contain;
  display: block;
}

.logo-sidebar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #dbe4f3;
  font-size: 12px;
  line-height: 1.15;
}

.logo-asset-status-light {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  justify-self: end;
  box-shadow: 0 0 0 1px #0b111b, 0 0 10px rgba(255,255,255,.08);
}

.logo-sidebar-row.is-prepared .logo-asset-status-light {
  background: #32d583;
}

.logo-sidebar-row.is-unprepared .logo-asset-status-light {
  background: #fdb022;
}

/* Disable the old strip light pseudo-elements for sidebar rows; the new point is explicit */
.logo-sidebar-row.logo-asset-card::after {
  content: none !important;
}

.logo-sidebar-row .logo-asset-filetype {
  min-width: 0;
  height: auto;
  font-size: 9px;
  padding: 2px 4px;
}


/* v2.10 — logo sidebar menu refinements */
.logo-sidebar-menu {
  left: 100% !important;
  width: 200px !important;
  max-width: 200px !important;
}

/* Invisible hover bridge: keeps the menu open while moving from the Logo button into the menu. */
.logo-tool-wrap::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 0;
  width: 8px;
  height: 100%;
  z-index: 14999;
}

.logo-sidebar-row.logo-asset-card {
  grid-template-columns: 34px minmax(0, 1fr) !important;
  gap: 7px !important;
  padding: 4px 18px 4px 6px !important;
  text-align: left !important;
  justify-items: stretch !important;
}

.logo-sidebar-label {
  text-align: left !important;
  justify-self: stretch !important;
  font-size: 10px !important;
  line-height: 1.12 !important;
  max-width: 100% !important;
}

.logo-asset-status-light {
  position: absolute !important;
  right: 6px !important;
  top: 6px !important;
  bottom: auto !important;
  width: 7px !important;
  height: 7px !important;
  justify-self: auto !important;
}

.logo-sidebar-thumb {
  width: 32px !important;
  height: 32px !important;
}

.logo-sidebar-thumb img {
  max-width: 28px !important;
  max-height: 28px !important;
}


/* v2.11 — all sliders reach visual start/end */
input[type="range"] {
  padding: 0 !important;
}

/* v2.11 — patternShape contextual bar without draw/upload buttons */
.pattern-shape-context-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  scrollbar-width: thin !important;
  height: 36px !important;
  padding: 0 4px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.pattern-shape-context-controls label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    white-space: nowrap !important;
    font-size: 10px !important;
    color: var(--muted) !important;
}

.pattern-shape-context-controls input[type="range"] {
  width: 92px !important;
  padding: 0 !important;
  accent-color: var(--accent) !important;
}

.pattern-shape-context-controls span[id$="Val"] {
    display: inline-block !important;
    min-width: 21px !important;
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
}


.pattern-shape-color-control {
  gap: 6px !important;
  margin-right: 3px !important;
}

.pattern-shape-palette-icon {
  width: 20px !important;
  height: 20px !important;
  fill: #d7e3f4 !important;
  flex: 0 0 auto !important;
  display: block !important;
}

#patternShapeColor {
  width: 28px !important;
  height: 28px !important;
  padding: 1px !important;
  border: 1px solid #394254 !important;
  border-radius: 6px !important;
  background: #0f131b !important;
  color: var(--text) !important;
  cursor: pointer !important;
}

.pattern-shape-separator {
  color: #475569 !important;
  font-size: 12px !important;
  line-height: 1 !important;
}


/* v2.15 — curve tool confirm/cancel preview controls */
.curve-controls input[type="range"] {
  width: 110px !important;
  padding: 0 !important;
}

.curve-controls span[id$="Val"] {
  display: inline-block !important;
  min-width: 42px !important;
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}


/* v2.17 — Gallery modal */
.gallery-dialog-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 560px;
  max-width: 700px;
}

.gallery-upload-btn {
  align-self: flex-start;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid #4aa3ff;
  border-radius: 10px;
  background: #16233a;
  color: #dbeafe;
  font-weight: 700;
  cursor: pointer;
}

.gallery-upload-btn:hover {
  background: #1d3153;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.gallery-thumb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 7px;
  border: 1px solid #2f3748;
  border-radius: 12px;
  background: #10141d;
  color: #dbe4f3;
  cursor: pointer;
  text-align: left;
}

.gallery-thumb:hover {
  border-color: #4aa3ff;
  background: #182033;
}

.gallery-thumb-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #0b1018;
  border: 1px solid rgba(255,255,255,.08);
}

.gallery-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-thumb-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.2;
  color: #cbd5e1;
}

.gallery-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  padding: 12px 4px;
}


/* v2.18 — Gallery modal width, upload tile and internal scroll */
#galleryDialog {
  width: 660px !important;
  box-sizing: border-box !important;
}

#galleryDialog.ui-dialog-content {
  max-height: min(72vh, 620px) !important;
  overflow: hidden !important;
}

.ui-dialog:has(#galleryDialog) {
  width: 660px !important;
}

.gallery-dialog-inner {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.gallery-thumbs {
  max-height: min(58vh, 480px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 6px !important;
}

.gallery-upload-btn {
  display: none !important;
}

.gallery-upload-thumb {
  border-style: dashed !important;
  border-color: rgba(74, 163, 255, .65) !important;
  background: #111a2a !important;
}

.gallery-upload-thumb:hover {
  background: #182b46 !important;
}

.gallery-upload-thumb-img {
  background: rgba(74, 163, 255, .08) !important;
}

.gallery-upload-plus {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(74, 163, 255, .55);
  border-radius: 999px;
  color: rgba(219, 234, 254, .9);
  font-size: 32px;
  line-height: 1;
  font-weight: 300;
}


/* v2.19 — Gallery centered in workspace */
.gallery-ui-dialog {
  width: 660px !important;
  max-width: 660px !important;
}


/* v2.20 — logo-prep cropper and Pantone UX fixes */
#logoPrepEditorDialog .cropper-modal {
  background: transparent !important;
  background-color: transparent !important;
  opacity: 0 !important;
}

#logoPrepEditorDialog .cropper-view-box,
#logoPrepEditorDialog .cropper-face {
  background: transparent !important;
}

#inlineLogoPrepApplyCrop:disabled,
#inlineLogoPrepConfirm:disabled {
  opacity: .45 !important;
  cursor: wait !important;
}


/* v2.21 — logo-prep cropper stability and darker checkered background */
#logoPrepEditorDialog .cropper-modal,
#logoPrepEditorDialog .cropper-face {
  background-color: transparent !important;
  opacity: 0 !important;
}

#logoPrepEditorDialog .cropper-view-box {
  /* outline-color: rgba(74, 163, 255, .95) !important; */
  outline: dotted 1px rgba(74, 163, 255, .95) !important;
}

#logoPrepEditorDialog .cropper-line,
#logoPrepEditorDialog .cropper-point {
  background-color: rgba(74, 163, 255, .95) !important;
}

#logoPrepEditorDialog .logo-prep-stage,
#logoPrepEditorDialog .inline-logo-prep-preview {
  background-color: #9aa3b0 !important;
  background-image:
    linear-gradient(45deg, #747e8c 25%, transparent 25%),
    linear-gradient(-45deg, #747e8c 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #747e8c 75%),
    linear-gradient(-45deg, transparent 75%, #747e8c 75%) !important;
  background-size: 18px 18px !important;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0 !important;
}


/* v2.22 — darker logo-prep checkered background */
#logoPrepEditorDialog .logo-prep-stage,
#logoPrepEditorDialog .inline-logo-prep-preview {
  background-color: #9aa3b0 !important;
  background-image:
    linear-gradient(45deg, #747e8c 25%, transparent 25%),
    linear-gradient(-45deg, #747e8c 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #747e8c 75%),
    linear-gradient(-45deg, transparent 75%, #747e8c 75%) !important;
  background-size: 18px 18px !important;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0 !important;
}


/* v2.30 — Report invalid area modal */
.report-invalid-area-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.report-invalid-area-label {
  color: #dbe4f3;
  font-size: 12px;
  font-weight: 700;
}

.report-invalid-area-textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  background: #0f131b;
  border: 1px solid #394254;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  outline: none;
  box-sizing: border-box;
}

.report-invalid-area-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 163, 255, .14);
}

.report-invalid-area-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dbe4f3;
  font-size: 12px;
}

.report-invalid-area-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  padding-top: 4px;
}

.report-invalid-area-status {
  color: var(--muted);
  font-size: 12px;
}

.report-invalid-area-ui-dialog {
  width: 660px !important;
  max-width: 660px !important;
}


/* v2.31 — Show debug info modal */
.debug-info-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.debug-info-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.debug-info-meta {
  color: var(--muted);
  font-size: 12px;
}

.debug-info-log {
  width: 100%;
  min-height: 460px;
  max-height: min(68vh, 640px);
  resize: vertical;
  overflow: auto;
  background: #080b10;
  border: 1px solid #394254;
  color: #dbe4f3;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.42;
  outline: none;
  box-sizing: border-box;
  white-space: pre;
}

.debug-info-log:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 163, 255, .14);
}

.debug-info-ui-dialog {
  width: 760px !important;
  max-width: 760px !important;
}


/* v2.33 — keep top menu dropdowns above editor toolbars */
#mainMenuBar {
  position: sticky !important;
  z-index: 30000 !important;
  overflow: visible !important;
}

.menu-nav,
.menu-item {
  overflow: visible !important;
}

.menu-dropdown {
  z-index: 30010 !important;
}

#appShell,
#workspace,
#topbar,
#leftToolbar {
  z-index: auto;
}


/* v2.34 — max logo size warning */
.ctx-print-size-panel {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.max-logo-warning {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: 3px;
  border-radius: 999px;
  background: rgba(255, 193, 7, .16);
  border: 1px solid rgba(255, 193, 7, .65);
  color: #ffd166;
  font-size: 11px;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.max-logo-warning[hidden] {
  display: none !important;
}

.attach-design-btn {
  position: relative;
}

.attach-design-btn.has-max-logo-warning::after {
  content: "⚠";
  position: absolute;
  top: -9px;
  right: -9px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #2b210b;
  border: 1px solid rgba(255, 193, 7, .85);
  color: #ffd166;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .35);
  pointer-events: none;
}

.attach-design-btn.has-max-logo-warning:hover::before {
  content: attr(data-max-logo-warning);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(460px, 80vw);
  white-space: normal;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  background: #11151d;
  color: #f8fafc;
  border: 1px solid rgba(255, 193, 7, .55);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.35;
  z-index: 40000;
}


/* v2.35 — refined max logo warning icon */
.max-logo-warning {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 17px !important;
  height: 17px !important;
  padding: 0 !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  line-height: 17px !important;
  text-align: center !important;
}

.attach-design-btn.has-max-logo-warning::after {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    padding-bottom: 2px;
    padding-left: 2px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
    text-align: center !important;
}


/* v2.36 — max-logo warning also in object dimensions panel */
.ctx-dimensions-panel .max-logo-warning {
  margin-left: 6px !important;
  flex: 0 0 auto !important;
  transform: translateY(0) !important;
}


/* v2.40 — close logo sidebar menu after adding/selecting a logo */
.logo-tool-wrap.force-closed .logo-sidebar-menu {
  display: none !important;
}


/* v2.42 — logo count badge and hide empty logo menu */
.logo-tool-wrap:not(.has-logo-assets) .logo-sidebar-menu {
  display: none !important;
}

.logo-tool-wrap > .tool[data-tool="add-logo"] {
  position: relative;
}

.logo-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 14px !important;
  height: 14px !important;
  padding: 0px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #4aa3ff;
  color: #07111f;
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .35);
  font-size: 9px !important;
  font-weight: 600 !important;
  line-height: 18px;
  pointer-events: none;
  box-sizing: border-box;
}


.logo-count-badge[hidden] {
  display: none !important;
}


/* v2.43 — print-area mask toggle in image contextual toolbar */
.ctx-opacity-panel {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.ctx-mask-toggle {
  height: 28px !important;
  padding: 0 12px !important;
  white-space: nowrap !important;
  color: rgba(215, 227, 244, .92) !important;
}

/* v2.59 embedded mode: jQuery UI modals must always stay above the app menu. */
.ui-widget-overlay {
  z-index: 29990 !important;
}
.ui-dialog {
  z-index: 30000 !important;
}
.ui-selectmenu-open,
.ui-datepicker,
.ui-menu.ui-widget,
.ui-autocomplete {
  z-index: 30010 !important;
}


/* v2.64 — dialogs/selectmenus are owned by the app shell when embedded by AJAX. */
#appShell > .ui-dialog {
  position: absolute;
  z-index: 30000 !important;
}
#appShell > .ui-widget-overlay {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 29990 !important;
}
.filter-pattern-selectmenu-menu,
.filter-pattern-selectmenu-menu.ui-selectmenu-open,
.ui-selectmenu-menu.filter-pattern-selectmenu-menu,
.ui-selectmenu-menu.filter-pattern-selectmenu-menu.ui-selectmenu-open {
  z-index: 31000 !important;
}
.filter-pattern-selectmenu-menu .ui-menu,
.ui-selectmenu-menu.filter-pattern-selectmenu-menu .ui-menu {
  z-index: 31001 !important;
}