#mpg-root{margin:20px 0;max-width:900px}
.mpg-toolbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:end;margin-bottom:14px}
.mpg-field label{display:block;margin-bottom:6px}
.mpg-field select,.mpg-field button,.mpg-field input{width:100%}
.mpg-field--button{max-width:220px}
.mpg-preview-panel{margin-top:10px}
.mpg-preview-title{font-weight:700;margin-bottom:8px}
#mpg-canvas{width:100%;max-width:960px;height:auto;border:1px solid #ddd;border-radius:8px;display:block;background:#fff}
.mpg-hidden{display:none !important}
@media (max-width:700px){.mpg-toolbar{grid-template-columns:1fr 1fr}.mpg-field--button{grid-column:1/-1;max-width:none}}

#mpg-moss-structure-field{display:block}

#mpg-clear-pixel-edits{white-space:nowrap}

.mpg-overlay-controls{margin:14px 0 10px}
.mpg-overlay-status{font-size:12px;color:#666;margin-top:-2px;margin-bottom:10px}

.mpg-ui-section{margin:14px 0;padding:14px;border:1px solid #e5e7eb;border-radius:12px;background:#fff}
.mpg-ui-section__title{font-weight:700;margin:0 0 10px}
.mpg-ui-status{margin-top:8px;font-size:13px;color:#555}
#mpg-pixel-tile-effects{margin-top:12px}


/* V16.21 UX layout */
#mpg-root{
  width:100%;
  max-width:none;
  --mpg-preview-width:1215px;
}
#mpg-root .mpg-preview-panel{
  width:100%;
  max-width:var(--mpg-preview-width);
  margin:0 auto 24px;
}
#mpg-root .mpg-preview-panel canvas,
#mpg-root #mpg-canvas{
  width:100%;
  height:auto;
  display:block;
}
#mpg-root .mpg-ui-section{
  width:100%;
}
#mpg-root .mpg-toolbar{
  display:grid;
  grid-template-columns:repeat(2, minmax(260px, 1fr));
  gap:14px 18px;
  align-items:start;
}
#mpg-root .mpg-field{
  min-width:0;
}
#mpg-root .mpg-field--button{
  align-self:end;
}
@media (max-width: 960px){
  #mpg-root .mpg-toolbar{
    grid-template-columns:1fr;
  }
}


/* V16.22 placement */
#mpg-root.mpg-root-fullwidth{
  width:100vw;
  max-width:100vw;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
  padding:24px clamp(16px, 3vw, 40px);
  box-sizing:border-box;
  background:#fff;
}
#mpg-root.mpg-root-fullwidth .mpg-preview-panel{
  max-width:var(--mpg-preview-width, 1215px);
}


/* V16.22a scale correction */
#mpg-root.mpg-root-fullwidth{
  padding-top: 28px;
  padding-bottom: 28px;
}
#mpg-root .mpg-preview-panel{
  width: min(100%, var(--mpg-preview-width));
}
#mpg-root .mpg-preview-panel .mpg-ui-section__title,
#mpg-root .mpg-controls-shell .mpg-ui-section__title{
  margin-bottom: 10px;
}
#mpg-root .mpg-ui-section{
  box-sizing: border-box;
}


/* V16.23 detached product app shell */
#mpg-root.mpg-root-fullwidth{
  position: relative;
}
#mpg-root .mpg-detached-shell{
  display:grid;
  grid-template-columns:minmax(320px, 1.05fr) minmax(320px, 1fr);
  gap:28px;
  align-items:start;
  margin-bottom:28px;
}
#mpg-root .mpg-detached-media,
#mpg-root .mpg-detached-summary{
  min-width:0;
}
#mpg-root .mpg-detached-summary{
  display:flex;
  flex-direction:column;
  gap:14px;
}
#mpg-root .mpg-detached-title .product_title{
  margin:0;
}
#mpg-root .mpg-detached-form form.cart{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
}
#mpg-root .mpg-detached-form .quantity{
  margin:0 !important;
}
#mpg-root .mpg-detached-meta,
#mpg-root .mpg-detached-excerpt{
  font-size:14px;
}
body.mpg-detached-active .summary.entry-summary.mpg-summary-detached{
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
}
body.mpg-detached-active .summary.entry-summary.mpg-summary-detached > *{
  display:none !important;
}
body.mpg-detached-active div.product.mpg-product-detached > .images,
body.mpg-detached-active div.product.mpg-product-detached > .woocommerce-product-gallery{
  display:none !important;
}
@media (max-width: 1100px){
  #mpg-root .mpg-detached-shell{
    grid-template-columns:1fr;
  }
}


/* V16.23a plugin-only fields under preview */
#mpg-root.mpg-root-fullwidth{
  width:100%;
  max-width:100%;
  margin-left:auto;
  margin-right:auto;
  padding:24px clamp(16px, 2.5vw, 32px);
  display:grid;
  grid-template-columns:repeat(3, minmax(260px, 1fr));
  gap:18px;
  align-items:start;
  box-sizing:border-box;
}
#mpg-root.mpg-root-fullwidth .mpg-preview-panel{
  grid-column:1 / -1;
  justify-self:center;
  margin:0 auto 8px;
}
#mpg-root.mpg-root-fullwidth .mpg-ui-section{
  margin:0;
  width:100%;
}
#mpg-root.mpg-root-fullwidth #mpg-color-controls,
#mpg-root.mpg-root-fullwidth #mpg-moss-controls,
#mpg-root.mpg-root-fullwidth #mpg-pixelart-controls{
  grid-column:auto;
}
#mpg-root.mpg-root-fullwidth #mpg-overlay-controls{
  grid-column:auto;
}
#mpg-root.mpg-root-fullwidth .mpg-toolbar{
  grid-template-columns:1fr;
  gap:12px;
}
#mpg-root.mpg-root-fullwidth .mpg-field--button{
  max-width:none;
}
#mpg-root .mpg-detached-shell,
#mpg-root .mpg-detached-media,
#mpg-root .mpg-detached-summary{
  display:none !important;
}
body.mpg-detached-active .summary.entry-summary.mpg-summary-detached,
body.mpg-detached-active div.product.mpg-product-detached > .images,
body.mpg-detached-active div.product.mpg-product-detached > .woocommerce-product-gallery{
  display:block !important;
  min-height:initial !important;
  margin:initial !important;
  padding:initial !important;
}
body.mpg-detached-active .summary.entry-summary.mpg-summary-detached > *{
  display:initial !important;
}
@media (max-width: 1100px){
  #mpg-root.mpg-root-fullwidth{
    grid-template-columns:1fr;
  }
}


/* V16.23b preview-first and fixed-scale rendering */
#mpg-root.mpg-root-fullwidth{
  align-items:start;
}
#mpg-root.mpg-root-fullwidth .mpg-preview-panel{
  order:-10;
  grid-column:1 / -1;
  width:min(var(--mpg-preview-width, 1215px), 100%);
  max-width:min(var(--mpg-preview-width, 1215px), 100%);
  justify-self:center;
  margin:0 auto 18px;
}
#mpg-root.mpg-root-fullwidth #mpg-canvas{
  width:100%;
  max-width:none;
  height:auto;
}
#mpg-root.mpg-root-fullwidth .mpg-ui-section{
  align-self:start;
}


/* V16.23c constrained preview scaling */
#mpg-root.mpg-root-fullwidth{
  --mpg-preview-height: 180px;
  --mpg-preview-scale: 1;
}
#mpg-root.mpg-root-fullwidth .mpg-preview-panel{
  width: var(--mpg-preview-width, 1215px);
  max-width: var(--mpg-preview-width, 1215px);
  flex: 0 0 auto;
  justify-self: center;
}
#mpg-root.mpg-root-fullwidth #mpg-canvas{
  width: var(--mpg-preview-width, 1215px);
  height: var(--mpg-preview-height, 180px);
  max-width: none;
}
@media (max-width: 1280px){
  #mpg-root.mpg-root-fullwidth .mpg-preview-panel{
    overflow: visible;
  }
}


/* V16.24 primary mode UX */
#mpg-root .mpg-field--full{
  grid-column:1 / -1;
}
#mpg-root .mpg-mode-cards{
  display:grid;
  grid-template-columns:repeat(3, minmax(120px, 1fr));
  gap:12px;
}
#mpg-root .mpg-mode-card{
  appearance:none;
  border:1px solid #d7dde5;
  background:#fff;
  border-radius:12px;
  padding:10px;
  text-align:left;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
#mpg-root .mpg-mode-card:hover{
  border-color:#aab7c7;
}
#mpg-root .mpg-mode-card.is-active{
  border-color:#7f8ea6;
  box-shadow:0 0 0 2px rgba(127,142,166,.15);
}
#mpg-root .mpg-mode-card__thumb{
  width:52px;
  height:36px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.08);
  flex:0 0 auto;
  display:block;
}
#mpg-root .mpg-mode-card__thumb--color{
  background:
    linear-gradient(90deg,#f3d7c4 0 25%,#75cbd1 25% 50%,#5478a5 50% 75%,#ead49a 75% 100%);
}
#mpg-root .mpg-mode-card__thumb--moss{
  background:
    radial-gradient(circle at 20% 30%, #7fae58 0 18%, transparent 19%),
    radial-gradient(circle at 55% 40%, #456a35 0 18%, transparent 19%),
    radial-gradient(circle at 78% 65%, #9bc772 0 18%, transparent 19%),
    linear-gradient(135deg,#dce8d3,#c5d8b4);
}
#mpg-root .mpg-mode-card__thumb--pixel{
  background:
    linear-gradient(90deg,transparent 0 24%,rgba(255,255,255,.2) 24% 26%,transparent 26% 49%,rgba(255,255,255,.2) 49% 51%,transparent 51% 74%,rgba(255,255,255,.2) 74% 76%,transparent 76% 100%),
    linear-gradient(transparent 0 24%,rgba(255,255,255,.2) 24% 26%,transparent 26% 49%,rgba(255,255,255,.2) 49% 51%,transparent 51% 74%,rgba(255,255,255,.2) 74% 76%,transparent 76% 100%),
    linear-gradient(135deg,#f0d0b4 0 25%,#57bfd0 25% 50%,#2e5578 50% 75%,#e8d27a 75% 100%);
}
#mpg-root .mpg-mode-card__label{
  font-weight:600;
  font-size:14px;
  line-height:1.2;
}
#mpg-root.mpg-root-fullwidth .mpg-ui-section:first-of-type .mpg-toolbar{
  grid-template-columns:repeat(2, minmax(220px, 1fr));
}
@media (max-width: 760px){
  #mpg-root .mpg-mode-cards{
    grid-template-columns:1fr;
  }
}


/* V16.25 material worlds UX */
#mpg-root .mpg-ui-section__eyebrow{
  font-size:12px;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:#6b7280;
  margin-bottom:6px;
}
#mpg-root .mpg-mode-cards--worlds{
  grid-template-columns:repeat(4, minmax(150px, 1fr));
  gap:14px;
}
#mpg-root .mpg-mode-card--world{
  min-height:88px;
  align-items:flex-start;
  padding:12px;
}
#mpg-root .mpg-mode-card__body{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
#mpg-root .mpg-mode-card__text{
  font-size:12px;
  line-height:1.35;
  color:#6b7280;
}
#mpg-root .mpg-mode-card__thumb--tile{
  background:
    linear-gradient(90deg,rgba(255,255,255,.18) 0 2%,transparent 2% 25%,rgba(255,255,255,.18) 25% 27%,transparent 27% 50%,rgba(255,255,255,.18) 50% 52%,transparent 52% 75%,rgba(255,255,255,.18) 75% 77%,transparent 77% 100%),
    linear-gradient(transparent 0 23%,rgba(255,255,255,.18) 23% 25%,transparent 25% 48%,rgba(255,255,255,.18) 48% 50%,transparent 50% 73%,rgba(255,255,255,.18) 73% 75%,transparent 75% 100%),
    linear-gradient(135deg,#cfb58f 0 25%,#8cb4b0 25% 50%,#58738f 50% 75%,#ead9b0 75% 100%);
}
@media (max-width: 980px){
  #mpg-root .mpg-mode-cards--worlds{
    grid-template-columns:repeat(2, minmax(150px, 1fr));
  }
}
@media (max-width: 640px){
  #mpg-root .mpg-mode-cards--worlds{
    grid-template-columns:1fr;
  }
}


/* V16.25a layout refinement */
#mpg-root.mpg-root-fullwidth{
  grid-template-columns:repeat(4, minmax(220px, 1fr));
  gap:18px;
}
#mpg-root.mpg-root-fullwidth .mpg-preview-panel{
  grid-column:1 / -1;
}
#mpg-root.mpg-root-fullwidth #mpg-color-controls,
#mpg-root.mpg-root-fullwidth #mpg-moss-controls,
#mpg-root.mpg-root-fullwidth #mpg-pixelart-controls,
#mpg-root.mpg-root-fullwidth #mpg-overlay-controls{
  grid-column:span 1;
}
#mpg-root.mpg-root-fullwidth .mpg-ui-section:first-of-type{
  grid-column:span 1;
}
#mpg-root .mpg-mode-cards--worlds{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
#mpg-root .mpg-mode-card--world{
  min-height:78px;
  padding:10px;
}
#mpg-root .mpg-mode-card__thumb{
  width:42px;
  height:30px;
}
#mpg-root .mpg-mode-card__label{
  font-size:13px;
}
#mpg-root .mpg-mode-card__text{
  font-size:11px;
}
#mpg-root .mpg-ui-section{
  overflow:hidden;
}
#mpg-root .mpg-field--full{
  min-width:0;
}
@media (max-width: 1280px){
  #mpg-root.mpg-root-fullwidth{
    grid-template-columns:repeat(2, minmax(260px, 1fr));
  }
}
@media (max-width: 760px){
  #mpg-root.mpg-root-fullwidth{
    grid-template-columns:1fr;
  }
  #mpg-root .mpg-mode-cards--worlds{
    grid-template-columns:1fr;
  }
}


/* V16.25c cleanup + top row material worlds */
#mpg-root.mpg-root-fullwidth{
  display:block !important;
  width:100vw;
  max-width:100vw;
}
#mpg-root.mpg-root-fullwidth > .mpg-preview-panel{
  display:block;
  width:min(var(--mpg-preview-width, 1215px), 100%);
  max-width:min(var(--mpg-preview-width, 1215px), 100%);
  margin:0 auto 18px auto !important;
}
#mpg-root.mpg-root-fullwidth > .mpg-ui-section--worlds{
  width:100%;
  max-width:1280px;
  margin:0 auto 18px auto !important;
}
#mpg-root .mpg-fields-grid{
  width:100%;
  max-width:1280px;
  margin:0 auto;
  display:grid;
  grid-template-columns:repeat(4, minmax(220px, 1fr));
  gap:18px;
  align-items:start;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section{
  width:100%;
  margin:0 !important;
  min-width:0;
  overflow:hidden;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section .mpg-toolbar{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section .mpg-field--full{
  grid-column:1 / -1;
}
#mpg-root .mpg-mode-cards--worlds{
  display:grid;
  grid-template-columns:repeat(4, minmax(180px, 1fr));
  gap:12px;
}
#mpg-root .mpg-mode-card--world{
  min-height:86px;
  padding:11px;
}
#mpg-root .mpg-mode-card__thumb{
  width:40px;
  height:30px;
}
#mpg-root .mpg-mode-card__text{
  font-size:11px;
}
#mpg-root .mpg-hidden{
  display:none !important;
}
@media (max-width: 1280px){
  #mpg-root .mpg-fields-grid{
    grid-template-columns:repeat(2, minmax(260px, 1fr));
  }
  #mpg-root .mpg-mode-cards--worlds{
    grid-template-columns:repeat(2, minmax(180px, 1fr));
  }
}
@media (max-width: 760px){
  #mpg-root .mpg-fields-grid{
    grid-template-columns:1fr;
  }
  #mpg-root .mpg-mode-cards--worlds{
    grid-template-columns:1fr;
  }
}


/* V16.25d visual cleanup */
#mpg-root.mpg-root-fullwidth > .mpg-ui-section--worlds,
#mpg-root .mpg-fields-grid > .mpg-ui-section{
  border:1px solid #dfe5ec;
  border-radius:16px;
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
#mpg-root .mpg-fields-grid{
  gap:22px;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section{
  padding:18px 18px 20px !important;
}
#mpg-root .mpg-ui-section__title{
  font-size:18px;
  line-height:1.25;
  margin:0 0 14px !important;
  font-weight:700;
  color:#1f2937;
}
#mpg-root .mpg-ui-section__eyebrow{
  font-size:11px;
  letter-spacing:.08em;
  color:#7b8794;
  margin-bottom:7px;
}
#mpg-root .mpg-field label{
  margin-bottom:7px;
  font-size:13px;
  line-height:1.35;
  color:#4b5563;
}
#mpg-root .mpg-field label strong{
  font-weight:700;
  color:#374151;
}
#mpg-root .mpg-field select,
#mpg-root .mpg-field input[type="file"],
#mpg-root .mpg-field input[type="range"],
#mpg-root .mpg-field button{
  font-size:14px;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section .mpg-toolbar{
  gap:14px;
}
#mpg-root .mpg-preview-title{
  font-size:20px;
  line-height:1.2;
  margin-bottom:12px;
  font-weight:700;
  color:#1f2937;
}
#mpg-root .mpg-mode-card--world{
  min-height:94px;
  padding:13px;
  border-radius:14px;
}
#mpg-root .mpg-mode-card__thumb{
  width:46px;
  height:34px;
  border-radius:10px;
}
#mpg-root .mpg-mode-card__label{
  font-size:14px;
  font-weight:700;
}
#mpg-root .mpg-mode-card__text{
  font-size:12px;
  line-height:1.4;
}
#mpg-root .mpg-field--button{
  margin-top:4px;
}
#mpg-root #mpg-generate,
#mpg-root #mpg-generate-moss{
  min-height:42px;
  font-weight:700;
  letter-spacing:.01em;
}
#mpg-root .mpg-ui-status{
  margin-top:10px;
  font-size:12px;
  line-height:1.4;
  color:#6b7280;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section#mpg-color-controls,
#mpg-root .mpg-fields-grid > .mpg-ui-section#mpg-moss-controls,
#mpg-root .mpg-fields-grid > .mpg-ui-section#mpg-pixelart-controls,
#mpg-root .mpg-fields-grid > .mpg-ui-section#mpg-overlay-controls{
  align-self:start;
}
@media (max-width: 1280px){
  #mpg-root .mpg-ui-section__title{
    font-size:17px;
  }
}


/* V16.25e basis split layout */
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child{
  grid-column: 1 / -1;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-toolbar{
  display:grid;
  grid-template-columns:repeat(4, minmax(180px, 1fr)) !important;
  gap:16px 18px !important;
  align-items:start;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-field{
  min-width:0;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-field:nth-child(1){
  order:1; /* Panelgröße */
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-field:nth-child(2){
  order:2; /* Form */
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-field:nth-child(3){
  order:3; /* Layout */
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-field:nth-child(4){
  order:4; /* Rastergröße */
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-field:nth-child(5){
  order:5; /* Objektgröße */
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-field:nth-child(6){
  order:6; /* Pfadmodus */
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-field:nth-child(n+5){
  margin-top:2px;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-ui-section__title{
  margin-bottom:16px !important;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child{
  position:relative;
}
#mpg-root .mpg-fields-grid > .mpg-ui-section:first-child::after{
  content:"";
  display:block;
  height:0;
  border-top:1px solid #eef2f6;
  margin-top:14px;
  grid-column:1 / -1;
}
@media (max-width: 1280px){
  #mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-toolbar{
    grid-template-columns:repeat(2, minmax(220px, 1fr)) !important;
  }
}
@media (max-width: 760px){
  #mpg-root .mpg-fields-grid > .mpg-ui-section:first-child .mpg-toolbar{
    grid-template-columns:1fr !important;
  }
}


/* V16.25f real basis split */
#mpg-root .mpg-ui-section--basis{
  grid-column:1 / -1;
}
#mpg-root .mpg-ui-section--basis .mpg-toolbar{
  display:block !important;
}
#mpg-root .mpg-basis-top-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(180px, 1fr));
  gap:14px;
  margin-bottom:14px;
}
#mpg-root .mpg-basis-bottom-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(220px, 1fr));
  gap:14px;
}
#mpg-root .mpg-basis-card{
  border:1px solid #e6ebf1;
  border-radius:14px;
  background:#fbfcfe;
  padding:12px;
}
#mpg-root .mpg-basis-card label{
  display:block;
  margin-bottom:8px;
}
#mpg-root .mpg-basis-card select{
  width:100%;
}
#mpg-root .mpg-basis-subtitle{
  font-size:12px;
  line-height:1.3;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#7b8794;
  margin:4px 0 10px;
}
@media (max-width: 1280px){
  #mpg-root .mpg-basis-top-grid{
    grid-template-columns:repeat(2, minmax(220px, 1fr));
  }
}
@media (max-width: 760px){
  #mpg-root .mpg-basis-top-grid,
  #mpg-root .mpg-basis-bottom-grid{
    grid-template-columns:1fr;
  }
}


/* V16.26 panel size tabs */
#mpg-root .mpg-basis-card--panel-tabs{
  background:#f9fbfd;
}
#mpg-root .mpg-panel-cards{
  display:grid;
  grid-template-columns:repeat(4, minmax(90px, 1fr));
  gap:10px;
}
#mpg-root .mpg-panel-card{
  appearance:none;
  border:1px solid #d9e1e8;
  background:#fff;
  border-radius:12px;
  padding:12px 10px;
  font-size:14px;
  font-weight:700;
  line-height:1.2;
  color:#374151;
  cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
#mpg-root .mpg-panel-card:hover{
  border-color:#afbbc8;
}
#mpg-root .mpg-panel-card.is-active{
  border-color:#7f8ea6;
  box-shadow:0 0 0 2px rgba(127,142,166,.14);
  background:#f8fafc;
}
@media (max-width: 1280px){
  #mpg-root .mpg-panel-cards{
    grid-template-columns:repeat(2, minmax(110px, 1fr));
  }
}
@media (max-width: 760px){
  #mpg-root .mpg-panel-cards{
    grid-template-columns:1fr;
  }
}


/* V16.27 world scoped controls */
#mpg-root .mpg-world-stage{
  width:100%;
  max-width:1280px;
  margin:0 auto 18px;
}
#mpg-root .mpg-world-stage > .mpg-ui-section{
  width:100%;
  margin:0 !important;
}
#mpg-root .mpg-global-stage{
  width:100%;
  max-width:1280px;
  margin:18px auto 0;
}
#mpg-root .mpg-global-stage > .mpg-ui-section{
  width:100%;
  margin:0 !important;
}
#mpg-root .mpg-fields-grid{
  margin-top:0;
}
#mpg-root .mpg-world-stage .mpg-toolbar,
#mpg-root .mpg-global-stage .mpg-toolbar{
  display:grid;
  grid-template-columns:repeat(4, minmax(180px, 1fr));
  gap:14px;
}
#mpg-root .mpg-world-stage .mpg-field--button,
#mpg-root .mpg-global-stage .mpg-field--button{
  max-width:none;
}
#mpg-root .mpg-world-stage .mpg-ui-section__title,
#mpg-root .mpg-global-stage .mpg-ui-section__title{
  margin-bottom:14px !important;
}
@media (max-width: 1280px){
  #mpg-root .mpg-world-stage .mpg-toolbar,
  #mpg-root .mpg-global-stage .mpg-toolbar{
    grid-template-columns:repeat(2, minmax(220px, 1fr));
  }
}
@media (max-width: 760px){
  #mpg-root .mpg-world-stage .mpg-toolbar,
  #mpg-root .mpg-global-stage .mpg-toolbar{
    grid-template-columns:1fr;
  }
}


/* V16.27a panel sizes above worlds */
#mpg-root > .mpg-ui-section--panels{
  width:100%;
  max-width:1280px;
  margin:0 auto 18px auto !important;
  border:1px solid #dfe5ec;
  border-radius:16px;
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
  padding:16px 18px 18px;
}
#mpg-root > .mpg-ui-section--panels .mpg-panel-cards{
  display:grid;
  grid-template-columns:repeat(4, minmax(160px, 1fr));
  gap:12px;
}
#mpg-root > .mpg-ui-section--panels .mpg-panel-card{
  min-height:64px;
  border-radius:14px;
  font-size:15px;
}
#mpg-root .mpg-ui-section--basis .mpg-basis-top-grid{
  grid-template-columns:repeat(3, minmax(180px, 1fr));
}
@media (max-width: 1280px){
  #mpg-root > .mpg-ui-section--panels .mpg-panel-cards{
    grid-template-columns:repeat(2, minmax(160px, 1fr));
  }
  #mpg-root .mpg-ui-section--basis .mpg-basis-top-grid{
    grid-template-columns:repeat(2, minmax(220px, 1fr));
  }
}
@media (max-width: 760px){
  #mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
  #mpg-root .mpg-ui-section--basis .mpg-basis-top-grid{
    grid-template-columns:1fr;
  }
}


/* V16.27b centered placement before description tabs */
#mpg-root,
#mpg-root.mpg-root-fullwidth{
  clear: both !important;
  float: none !important;
  position: relative;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: min(1280px, calc(100% - 32px)) !important;
  max-width: 1280px !important;
  margin: 28px auto 32px auto !important;
  padding: 0 !important;
  box-sizing: border-box;
}
.single-product #mpg-root{
  display: block !important;
}
.single-product div.product #mpg-root{
  align-self: auto !important;
}
.single-product div.product .woocommerce-tabs{
  clear: both;
}
#mpg-root > .mpg-preview-panel,
#mpg-root > .mpg-ui-section--panels,
#mpg-root > .mpg-ui-section--worlds,
#mpg-root > .mpg-world-stage,
#mpg-root > .mpg-fields-grid,
#mpg-root > .mpg-global-stage{
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}


/* V16.27c hard top placement */
.single-product #mpg-root,
.single-product #mpg-root.mpg-root-fullwidth{
  order: -999 !important;
  margin-top: 20px !important;
  margin-bottom: 36px !important;
}
.single-product .product.type-product{
  clear: both;
}
.single-product .woocommerce-notices-wrapper + #mpg-root,
.single-product #mpg-root + .product{
  display: block;
}


/* V16.27d overall UI scale to 75% */
.single-product #mpg-root,
.single-product #mpg-root.mpg-root-fullwidth{
  --mpg-ui-scale: 0.75;
  transform: scale(var(--mpg-ui-scale));
  transform-origin: top center;
  width: calc(min(1280px, calc(100% - 32px)) / var(--mpg-ui-scale)) !important;
  max-width: calc(1280px / var(--mpg-ui-scale)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: calc(36px * var(--mpg-ui-scale)) !important;
}


/* V16.27f force all lower sections to exact preview track width */
.single-product #mpg-root{
  --mpg-track-width: min(var(--mpg-preview-width, 1215px), 100%);
}
.single-product #mpg-root > .mpg-preview-panel{
  width: var(--mpg-track-width) !important;
  max-width: var(--mpg-track-width) !important;
  min-width: 0 !important;
}
.single-product #mpg-root > .mpg-ui-section--panels,
.single-product #mpg-root > .mpg-ui-section--worlds,
.single-product #mpg-root > .mpg-world-stage,
.single-product #mpg-root > .mpg-fields-grid,
.single-product #mpg-root > .mpg-global-stage{
  width: var(--mpg-track-width) !important;
  max-width: var(--mpg-track-width) !important;
  min-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.single-product #mpg-root > .mpg-fields-grid > .mpg-ui-section,
.single-product #mpg-root > .mpg-world-stage > .mpg-ui-section,
.single-product #mpg-root > .mpg-global-stage > .mpg-ui-section{
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}


/* V16.27g fixed maximum track width independent of current format */
.single-product #mpg-root,
.single-product #mpg-root.mpg-root-fullwidth{
  --mpg-fixed-track: 1215px;
  --mpg-track-width: min(var(--mpg-fixed-track), calc(100% - 32px));
  left: auto !important;
  right: auto !important;
}
.single-product #mpg-root > .mpg-preview-panel{
  width: var(--mpg-track-width) !important;
  max-width: var(--mpg-track-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
}
.single-product #mpg-root > .mpg-ui-section--panels,
.single-product #mpg-root > .mpg-ui-section--worlds,
.single-product #mpg-root > .mpg-world-stage,
.single-product #mpg-root > .mpg-fields-grid,
.single-product #mpg-root > .mpg-global-stage{
  width: var(--mpg-track-width) !important;
  max-width: var(--mpg-track-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.single-product #mpg-root #mpg-canvas{
  max-width: 100% !important;
}


/* V16.27h centering fix against article content */
.single-product #mpg-root,
.single-product #mpg-root.mpg-root-fullwidth{
  left: 50% !important;
  right: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transform: translateX(-50%) scale(var(--mpg-ui-scale, 0.75)) !important;
  transform-origin: top center !important;
}


/* V16.27i full-width 5-column layout without global scaling */
.single-product #mpg-root,
.single-product #mpg-root.mpg-root-fullwidth{
  --mpg-ui-scale: 1 !important;
  --mpg-fixed-track: min(1600px, calc(100vw - 72px));
  --mpg-track-width: var(--mpg-fixed-track);
  width: var(--mpg-fixed-track) !important;
  max-width: var(--mpg-fixed-track) !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  margin: 18px auto 18px auto !important;
  padding: 0 !important;
}

.single-product #mpg-root > .mpg-preview-panel,
.single-product #mpg-root > .mpg-ui-section--panels,
.single-product #mpg-root > .mpg-ui-section--worlds,
.single-product #mpg-root > .mpg-world-stage,
.single-product #mpg-root > .mpg-fields-grid,
.single-product #mpg-root > .mpg-global-stage{
  width: var(--mpg-fixed-track) !important;
  max-width: var(--mpg-fixed-track) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.single-product #mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
.single-product #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.single-product #mpg-root > .mpg-world-stage .mpg-toolbar,
.single-product #mpg-root > .mpg-global-stage .mpg-toolbar{
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.single-product #mpg-root > .mpg-fields-grid{
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.single-product #mpg-root > .mpg-fields-grid > .mpg-ui-section{
  width: 100% !important;
  max-width: 100% !important;
}

.single-product #mpg-root .mpg-panel-card,
.single-product #mpg-root .mpg-mode-card--world{
  min-height: 58px !important;
  padding: 10px !important;
}

.single-product #mpg-root .mpg-mode-card__thumb{
  width: 34px !important;
  height: 26px !important;
}

.single-product #mpg-root .mpg-mode-card__label{
  font-size: 13px !important;
}

.single-product #mpg-root .mpg-mode-card__text{
  font-size: 10px !important;
  line-height: 1.25 !important;
}

.single-product #mpg-root .mpg-ui-section__title{
  font-size: 16px !important;
  margin-bottom: 10px !important;
}

.single-product #mpg-root .mpg-field label{
  font-size: 12px !important;
  margin-bottom: 5px !important;
}

.single-product #mpg-root .mpg-field select,
.single-product #mpg-root .mpg-field input[type="file"],
.single-product #mpg-root .mpg-field button{
  font-size: 13px !important;
}

.single-product #mpg-root + .product{
  margin-top: 8px !important;
}

@media (max-width: 1400px){
  .single-product #mpg-root,
  .single-product #mpg-root.mpg-root-fullwidth{
    --mpg-fixed-track: calc(100vw - 48px);
  }
  .single-product #mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
  .single-product #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds,
  .single-product #mpg-root > .mpg-world-stage .mpg-toolbar,
  .single-product #mpg-root > .mpg-global-stage .mpg-toolbar,
  .single-product #mpg-root > .mpg-fields-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px){
  .single-product #mpg-root,
  .single-product #mpg-root.mpg-root-fullwidth{
    --mpg-fixed-track: calc(100vw - 28px);
  }
  .single-product #mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
  .single-product #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds,
  .single-product #mpg-root > .mpg-world-stage .mpg-toolbar,
  .single-product #mpg-root > .mpg-global-stage .mpg-toolbar,
  .single-product #mpg-root > .mpg-fields-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px){
  .single-product #mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
  .single-product #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds,
  .single-product #mpg-root > .mpg-world-stage .mpg-toolbar,
  .single-product #mpg-root > .mpg-global-stage .mpg-toolbar,
  .single-product #mpg-root > .mpg-fields-grid{
    grid-template-columns: 1fr !important;
  }
}


/* V16.27j lock plugin to actual site content width */
.single-product #mpg-root,
.single-product #mpg-root.mpg-root-fullwidth{
  --mpg-site-track-width: min(1280px, calc(100vw - 48px));
  --mpg-fixed-track: min(1215px, var(--mpg-site-track-width));
  --mpg-track-width: var(--mpg-fixed-track);
  width: var(--mpg-site-track-width) !important;
  max-width: var(--mpg-site-track-width) !important;
  box-sizing: border-box !important;
}

.single-product #mpg-root > .mpg-preview-panel,
.single-product #mpg-root > .mpg-ui-section--panels,
.single-product #mpg-root > .mpg-ui-section--worlds,
.single-product #mpg-root > .mpg-world-stage,
.single-product #mpg-root > .mpg-fields-grid,
.single-product #mpg-root > .mpg-global-stage{
  width: var(--mpg-track-width) !important;
  max-width: var(--mpg-track-width) !important;
  box-sizing: border-box !important;
}

.single-product #mpg-root > .mpg-preview-panel{
  margin-left: auto !important;
  margin-right: auto !important;
}


/* V16.27k hard centering reset */
.single-product #mpg-root,
.single-product #mpg-root.mpg-root-fullwidth{
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  float: none !important;
  clear: both !important;
  transform: none !important;
  margin: 18px auto 18px auto !important;
  width: min(var(--mpg-site-track-width, calc(100vw - 48px)), calc(100vw - 48px)) !important;
  max-width: min(var(--mpg-site-track-width, calc(100vw - 48px)), calc(100vw - 48px)) !important;
}
.single-product #mpg-root > .mpg-preview-panel,
.single-product #mpg-root > .mpg-ui-section--panels,
.single-product #mpg-root > .mpg-ui-section--worlds,
.single-product #mpg-root > .mpg-world-stage,
.single-product #mpg-root > .mpg-fields-grid,
.single-product #mpg-root > .mpg-global-stage{
  position: static !important;
  left: auto !important;
  transform: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}


/* V16.27l explicit centering wrapper */
.single-product .mpg-page-wrap{
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  clear: both !important;
  float: none !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  margin: 18px 0 !important;
  padding: 0 !important;
  text-align: initial !important;
}

.single-product .mpg-page-wrap #mpg-root,
.single-product .mpg-page-wrap #mpg-root.mpg-root-fullwidth{
  flex: 0 1 auto !important;
  position: static !important;
  float: none !important;
  clear: both !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  margin: 0 auto !important;
}

.single-product .mpg-page-wrap + .product{
  margin-top: 8px !important;
}


/* V16.27p hard mix default + compact 5-cell basis */
#mpg-root .mpg-basis-top-grid{
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:12px !important;
  margin-bottom:0 !important;
}
#mpg-root .mpg-basis-bottom-grid,
#mpg-root .mpg-basis-subtitle{
  display:none !important;
}
#mpg-root .mpg-ui-section--basis .mpg-basis-card{
  min-width:0;
}
#mpg-root .mpg-ui-section--basis .mpg-basis-card label{
  font-size:12px;
}
@media (max-width: 1280px){
  #mpg-root .mpg-basis-top-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 760px){
  #mpg-root .mpg-basis-top-grid{
    grid-template-columns:1fr !important;
  }
}


/* V16.27q layout correction for basis + overlay */
#mpg-root > .mpg-global-stage{
  width: var(--mpg-track-width) !important;
  max-width: var(--mpg-track-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: block !important;
  clear: both !important;
}

#mpg-root > .mpg-global-stage > .mpg-ui-section,
#mpg-root #mpg-overlay-controls{
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  float: none !important;
  position: static !important;
  clear: both !important;
}

#mpg-root #mpg-overlay-controls .mpg-toolbar{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: start !important;
}

#mpg-root .mpg-ui-section--basis{
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
}

#mpg-root .mpg-basis-top-grid{
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 0 !important;
  align-items: start !important;
}

#mpg-root .mpg-basis-top-grid > .mpg-basis-card{
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  grid-column: auto !important;
}

#mpg-root .mpg-basis-top-grid > .mpg-basis-card select{
  width: 100% !important;
}

#mpg-root .mpg-basis-bottom-grid,
#mpg-root .mpg-basis-subtitle{
  display: none !important;
}

@media (max-width: 1280px){
  #mpg-root .mpg-basis-top-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  #mpg-root #mpg-overlay-controls .mpg-toolbar{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px){
  #mpg-root .mpg-basis-top-grid,
  #mpg-root #mpg-overlay-controls .mpg-toolbar{
    grid-template-columns: 1fr !important;
  }
}


/* V16.27r markup repair after malformed basis block */
#mpg-root .mpg-basis-top-grid{
  display:grid !important;
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:12px !important;
}
#mpg-root > .mpg-global-stage{
  display:block !important;
  clear:both !important;
  margin-top:14px !important;
}
#mpg-root #mpg-overlay-controls{
  width:100% !important;
  max-width:100% !important;
  float:none !important;
  position:static !important;
}


/* V16.27s consistent container padding + basis after panel sizes */
#mpg-root > .mpg-ui-section--panels,
#mpg-root > .mpg-ui-section--worlds,
#mpg-root .mpg-ui-section--basis,
#mpg-root .mpg-world-stage > .mpg-ui-section,
#mpg-root .mpg-global-stage > .mpg-ui-section{
  padding:16px 18px 18px !important;
  box-sizing:border-box !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-ui-section__title,
#mpg-root > .mpg-ui-section--worlds .mpg-ui-section__title{
  margin:0 0 14px !important;
  padding:0 !important;
  font-size:18px;
  line-height:1.25;
  font-weight:700;
  color:#1f2937;
}

#mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  margin:0 !important;
}

#mpg-root .mpg-ui-section--basis{
  margin:18px auto 18px auto !important;
  width:var(--mpg-track-width) !important;
  max-width:var(--mpg-track-width) !important;
}

#mpg-root .mpg-ui-section--basis .mpg-ui-section__title{
  margin:0 0 14px !important;
}

#mpg-root .mpg-global-stage{
  margin-top:18px !important;
}

@media (max-width: 760px){
  #mpg-root > .mpg-ui-section--panels,
  #mpg-root > .mpg-ui-section--worlds,
  #mpg-root .mpg-ui-section--basis,
  #mpg-root .mpg-world-stage > .mpg-ui-section,
  #mpg-root .mpg-global-stage > .mpg-ui-section{
    padding:14px !important;
  }
}


/* V16.27t clean top-section ordering and spacing */
#mpg-root > .mpg-ui-section--panels,
#mpg-root > .mpg-ui-section--basis,
#mpg-root > .mpg-ui-section--worlds,
#mpg-root > .mpg-world-stage,
#mpg-root > .mpg-global-stage{
  width: var(--mpg-track-width) !important;
  max-width: var(--mpg-track-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  clear: both !important;
  float: none !important;
}

#mpg-root > .mpg-ui-section--panels,
#mpg-root > .mpg-ui-section--basis,
#mpg-root > .mpg-ui-section--worlds,
#mpg-root > .mpg-world-stage > .mpg-ui-section,
#mpg-root > .mpg-global-stage > .mpg-ui-section{
  padding: 16px 18px 18px !important;
  box-sizing: border-box !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-ui-section__title,
#mpg-root > .mpg-ui-section--basis .mpg-ui-section__title,
#mpg-root > .mpg-ui-section--worlds .mpg-ui-section__title{
  margin: 0 0 14px !important;
  padding: 0 !important;
}

#mpg-root > .mpg-ui-section--basis{
  margin-top: 18px !important;
  margin-bottom: 18px !important;
}

#mpg-root > .mpg-ui-section--worlds{
  margin-bottom: 18px !important;
}

#mpg-root > .mpg-world-stage{
  margin-bottom: 18px !important;
}

#mpg-root .mpg-basis-top-grid{
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 0 !important;
}
#mpg-root .mpg-basis-bottom-grid,
#mpg-root .mpg-basis-subtitle{
  display: none !important;
}

#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

#mpg-root > .mpg-global-stage #mpg-overlay-controls{
  display: block !important;
  position: static !important;
  float: none !important;
}

@media (max-width: 1280px){
  #mpg-root .mpg-basis-top-grid,
  #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 760px){
  #mpg-root .mpg-basis-top-grid,
  #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
    grid-template-columns: 1fr !important;
  }
}


/* V16.27u title/card inset refinement */
#mpg-root > .mpg-ui-section--panels,
#mpg-root > .mpg-ui-section--worlds{
  padding:18px 18px 18px !important;
  box-sizing:border-box !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-ui-section__title,
#mpg-root > .mpg-ui-section--worlds .mpg-ui-section__title{
  margin:0 0 14px 0 !important;
  padding-left:2px !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  margin:0 !important;
  padding:0 !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-panel-card{
  padding:12px !important;
  font-size:14px !important;
}


/* V16.27v match inset of Panelgrößen / Material Worlds to Basis / Farbe */
#mpg-root > .mpg-ui-section--panels,
#mpg-root > .mpg-ui-section--worlds{
  padding: 18px 20px 20px !important;
  box-sizing: border-box !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-ui-section__title,
#mpg-root > .mpg-ui-section--worlds .mpg-ui-section__title{
  margin: 0 0 16px 0 !important;
  padding: 0 !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-panel-card,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-card--world{
  margin: 0 !important;
}

@media (max-width: 760px){
  #mpg-root > .mpg-ui-section--panels,
  #mpg-root > .mpg-ui-section--worlds{
    padding: 16px !important;
  }
}


/* V16.27w hard patch: top container insets = basis, preview corners square */
#mpg-root > .mpg-ui-section--panels,
#mpg-root > .mpg-ui-section--worlds{
  padding-top: 16px !important;
  padding-right: 18px !important;
  padding-bottom: 18px !important;
  padding-left: 18px !important;
  box-sizing: border-box !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-ui-section__title,
#mpg-root > .mpg-ui-section--worlds .mpg-ui-section__title{
  margin-top: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 14px !important;
  margin-left: 0 !important;
  padding: 0 !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-panel-card,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-card--world{
  margin: 0 !important;
}

#mpg-root .mpg-preview-panel,
#mpg-root .mpg-preview-panel canvas,
#mpg-root #mpg-canvas{
  border-radius: 0 !important;
}


/* V16.28 tile library */
#mpg-pixelart-library-wrap{
  margin-top:10px;
}
#mpg-tile-library{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}
.mpg-tile-library__item{
  appearance:none;
  width:100%;
  text-align:left;
  border:1px solid #dfe5ec;
  background:#fff;
  border-radius:12px;
  padding:8px;
  display:flex;
  gap:10px;
  align-items:center;
  cursor:pointer;
}
.mpg-tile-library__item.is-active{
  border-color:#6f8098;
  box-shadow:0 0 0 2px rgba(111,128,152,.14);
}
.mpg-tile-library__thumb{
  width:52px;
  height:40px;
  border-radius:8px;
  overflow:hidden;
  background:#f4f6f8;
  flex:0 0 52px;
}
.mpg-tile-library__thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.mpg-tile-library__label{
  display:block;
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  color:#1f2937;
}
.mpg-tile-library__meta{
  display:block;
  margin-top:2px;
  font-size:11px;
  color:#6b7280;
}
@media (max-width:1280px){
  #mpg-tile-library{grid-template-columns:repeat(2, minmax(0, 1fr));}
}
@media (max-width:760px){
  #mpg-tile-library{grid-template-columns:1fr;}
}


/* V16.28a unify Pixel/Tile presentation and 5-column material worlds */
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  display:grid !important;
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:12px !important;
}

#mpg-root > .mpg-ui-section--worlds .mpg-mode-card--world{
  min-width:0 !important;
}

#mpg-root > .mpg-world-stage .mpg-toolbar{
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:12px !important;
}

#mpg-root #mpg-pixelart-controls .mpg-ui-section__title::after{
  content:"";
}

@media (max-width: 1280px){
  #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds,
  #mpg-root > .mpg-world-stage .mpg-toolbar{
    grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 760px){
  #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds,
  #mpg-root > .mpg-world-stage .mpg-toolbar{
    grid-template-columns:1fr !important;
  }
}


/* V16.28b material worlds cleanup + pixel block on 5 columns */
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

#mpg-root > .mpg-ui-section--worlds .mpg-mode-card--world{
  min-width: 0 !important;
}

/* Pixel / Tile block: force 5 columns so the controls align to the same grid logic */
#mpg-root #mpg-pixelart-controls .mpg-toolbar{
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: start !important;
}

#mpg-root #mpg-pixelart-controls .mpg-field{
  min-width: 0 !important;
}

#mpg-root #mpg-pixelart-library-wrap{
  grid-column: 1 / -1 !important;
}

@media (max-width: 1280px){
  #mpg-root #mpg-pixelart-controls .mpg-toolbar{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px){
  #mpg-root #mpg-pixelart-controls .mpg-toolbar{
    grid-template-columns: 1fr !important;
  }
}


/* V16.28f safe incremental UI */
#mpg-root > .mpg-ui-section--panels,
#mpg-root > .mpg-ui-section--worlds,
#mpg-root .mpg-ui-section--basis,
#mpg-root .mpg-world-stage > .mpg-ui-section,
#mpg-root .mpg-global-stage > .mpg-ui-section{
  padding:16px 18px 18px !important;
  box-sizing:border-box !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-ui-section__title,
#mpg-root > .mpg-ui-section--worlds .mpg-ui-section__title,
#mpg-root .mpg-ui-section--basis .mpg-ui-section__title,
#mpg-root .mpg-world-stage > .mpg-ui-section .mpg-ui-section__title,
#mpg-root .mpg-global-stage > .mpg-ui-section .mpg-ui-section__title{
  margin:0 0 14px !important;
  padding:0 !important;
}

#mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds,
#mpg-root .mpg-ui-section--basis .mpg-toolbar,
#mpg-root .mpg-world-stage > .mpg-ui-section .mpg-toolbar,
#mpg-root .mpg-global-stage > .mpg-ui-section .mpg-toolbar{
  margin:0 !important;
  width:100% !important;
  box-sizing:border-box !important;
}

#mpg-root #mpg-overlay-controls .mpg-toolbar{
  display:grid !important;
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:12px !important;
  align-items:start !important;
}

#mpg-root #mpg-pixel-edit,
#mpg-root #mpg-pixel-tone-wrap,
#mpg-root #mpg-clear-pixel-edits-wrap,
#mpg-root label[for="mpg-pixel-edit"],
#mpg-root #mpg-pixelart-enable-wrap,
#mpg-root #mpg-pixelart-enable,
#mpg-root label[for="mpg-pixelart-enable"]{
  display:none !important;
}

#mpg-root #mpg-pixel-edit,
#mpg-root #mpg-pixel-tone-wrap,
#mpg-root #mpg-clear-pixel-edits-wrap{
  visibility:hidden !important;
}

#mpg-root #mpg-pixelart-enable-wrap{
  display:none !important;
}

#mpg-root #mpg-pixelart-enable{
  position:absolute !important;
  left:-9999px !important;
}

@media (max-width:1280px){
  #mpg-root #mpg-overlay-controls .mpg-toolbar{
    grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width:760px){
  #mpg-root > .mpg-ui-section--panels,
  #mpg-root > .mpg-ui-section--worlds,
  #mpg-root .mpg-ui-section--basis,
  #mpg-root .mpg-world-stage > .mpg-ui-section,
  #mpg-root .mpg-global-stage > .mpg-ui-section{
    padding:14px !important;
  }
  #mpg-root #mpg-overlay-controls .mpg-toolbar{
    grid-template-columns:1fr !important;
  }
}


/* V16.28j row alignment polish */
#mpg-root #mpg-moss-controls .mpg-toolbar,
#mpg-root #mpg-pixelart-controls > .mpg-toolbar{
  display:grid !important;
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:12px !important;
  align-items:end !important;
}

#mpg-root #mpg-moss-preset,
#mpg-root label[for="mpg-moss-preset"]{
  display:none !important;
}

#mpg-root #mpg-moss-controls .mpg-field--button,
#mpg-root #mpg-pixelart-controls > .mpg-toolbar .mpg-field--button{
  max-width:none !important;
}

#mpg-root #mpg-pixelart-controls > .mpg-toolbar > .mpg-field{
  min-width:0;
}

@media (max-width:1280px){
  #mpg-root #mpg-moss-controls .mpg-toolbar,
  #mpg-root #mpg-pixelart-controls > .mpg-toolbar{
    grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width:760px){
  #mpg-root #mpg-moss-controls .mpg-toolbar,
  #mpg-root #mpg-pixelart-controls > .mpg-toolbar{
    grid-template-columns:1fr !important;
  }
}


#mpg-root #mpg-moss-controls .mpg-toolbar{
  display:grid !important;
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:12px !important;
  align-items:end !important;
}

#mpg-root #mpg-moss-effect-wrap,
#mpg-root #mpg-moss-effect-strength-wrap,
#mpg-root .mpg-field:has(#mpg-pixel-edit),
#mpg-root #mpg-pixel-tone-wrap,
#mpg-root #mpg-clear-pixel-edits-wrap{
  display:none !important;
}

#mpg-root #mpg-moss-controls .mpg-field--button{
  max-width:none !important;
  grid-column:auto !important;
}

#mpg-root #mpg-pixelart-controls > .mpg-toolbar{
  display:grid !important;
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:12px !important;
  align-items:end !important;
}

#mpg-root #mpg-pixelart-enable-wrap{
  display:none !important;
}

#mpg-root #mpg-pixelart-controls > .mpg-toolbar .mpg-field--button{
  max-width:none !important;
  grid-column:auto !important;
}

#mpg-root #mpg-pixelart-controls > .mpg-toolbar > .mpg-field,
#mpg-root #mpg-moss-controls .mpg-toolbar > .mpg-field{
  min-width:0 !important;
}

@media (max-width:1280px){
  #mpg-root #mpg-moss-controls .mpg-toolbar,
  #mpg-root #mpg-pixelart-controls > .mpg-toolbar{
    grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width:760px){
  #mpg-root #mpg-moss-controls .mpg-toolbar,
  #mpg-root #mpg-pixelart-controls > .mpg-toolbar{
    grid-template-columns:1fr !important;
  }
}


/* V16.28k default geo tile + card inset parity */
#mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  width:auto !important;
  margin-left:18px !important;
  margin-right:18px !important;
}

@media (max-width:760px){
  #mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
  #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
    margin-left:14px !important;
    margin-right:14px !important;
  }
}


/* V16.28l stronger real inset for Panelgrößen / Material Worlds + pixel row order */
#mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  padding-left: 16px !important;
  padding-right: 16px !important;
  box-sizing: border-box !important;
}

@media (max-width: 760px){
  #mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
  #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

#mpg-root #mpg-pixelart-controls .mpg-toolbar > #mpg-pixelart-tile-overlay-wrap{order:3 !important;}
#mpg-root #mpg-pixelart-controls .mpg-toolbar > .mpg-field:has(#mpg-pixelart-file){order:4 !important;}
#mpg-root #mpg-pixelart-controls .mpg-toolbar > .mpg-field--button{order:5 !important;}


/* V16.28m hard width-based inset parity for Panelgrößen / Material Worlds */
#mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
#mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  width: calc(100% - 32px) !important;
  max-width: calc(100% - 32px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 760px){
  #mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
  #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* V16.28n final parity fix: restore real section insets for Panelgrößen / Material Worlds on single-product */
.single-product #mpg-root > .mpg-ui-section--panels,
.single-product #mpg-root > .mpg-ui-section--worlds{
  padding-top: 16px !important;
  padding-right: 18px !important;
  padding-bottom: 18px !important;
  padding-left: 18px !important;
  box-sizing: border-box !important;
}

.single-product #mpg-root > .mpg-ui-section--panels .mpg-panel-cards,
.single-product #mpg-root > .mpg-ui-section--worlds .mpg-mode-cards--worlds{
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 760px){
  .single-product #mpg-root > .mpg-ui-section--panels,
  .single-product #mpg-root > .mpg-ui-section--worlds{
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}


/* V16.29d step 1 new worlds UI */
#mpg-root #mpg-wood-controls .mpg-toolbar,
#mpg-root #mpg-textile-controls .mpg-toolbar,
#mpg-root #mpg-mineral-controls .mpg-toolbar{
  display:grid !important;
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:12px !important;
  align-items:end !important;
}
#mpg-root #mpg-wood-controls .mpg-toolbar > .mpg-field,
#mpg-root #mpg-textile-controls .mpg-toolbar > .mpg-field,
#mpg-root #mpg-mineral-controls .mpg-toolbar > .mpg-field{min-width:0 !important;}
@media (max-width:1280px){
  #mpg-root #mpg-wood-controls .mpg-toolbar,
  #mpg-root #mpg-textile-controls .mpg-toolbar,
  #mpg-root #mpg-mineral-controls .mpg-toolbar{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
}
@media (max-width:760px){
  #mpg-root #mpg-wood-controls .mpg-toolbar,
  #mpg-root #mpg-textile-controls .mpg-toolbar,
  #mpg-root #mpg-mineral-controls .mpg-toolbar{grid-template-columns:1fr !important;}
}


/* V16.29e curated libraries */
.mpg-curated-library-wrap{
  margin-top: 10px;
}
.mpg-curated-library{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:10px;
}
.mpg-curated-library__item{
  appearance:none;
  width:100%;
  text-align:left;
  border:1px solid #dfe5ec;
  background:#fff;
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  color:#1f2937;
}
.mpg-curated-library__item span{
  display:block;
  margin-top:3px;
  font-size:11px;
  font-weight:400;
  color:#6b7280;
}
.mpg-curated-library__item.is-active{
  border-color:#6f8098;
  box-shadow:0 0 0 2px rgba(111,128,152,.14);
}
@media (max-width: 1280px){
  .mpg-curated-library{grid-template-columns:repeat(3, minmax(0, 1fr));}
}
@media (max-width: 760px){
  .mpg-curated-library{grid-template-columns:1fr;}
}


/* V16.29l reliable overlay restore from last verified working build */
#mpg-overlay-controls{
  width: var(--mpg-track-width) !important;
  max-width: var(--mpg-track-width) !important;
  margin: 18px auto 0 auto !important;
  display: block !important;
  float: none !important;
  clear: both !important;
  position: static !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
}
#mpg-overlay-controls .mpg-toolbar{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: start !important;
}
@media (max-width: 760px){
  #mpg-overlay-controls .mpg-toolbar{
    grid-template-columns: 1fr !important;
  }
}


.mpg-save-design-button{
  margin-right:12px;
  min-width:180px;
}
@media (max-width: 767px){
  .mpg-save-design-button{
    display:block;
    width:100%;
    margin:0 0 10px 0;
  }
}
