/* Pattern-/Inserter-Vorschau: gebündeltes Rasterbild statt WebGL (nur wenn PHP patternPreviews liefert). */
.ce-diagram-pattern-static-preview {
  width: 100%;
  max-width: 100%;
  line-height: 0;
}

.ce-diagram-wrapper.ce-diagram-editor-preview {
  height: auto;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  /* Same as frontend: minHeight is set by init.js (calcStageHeight). Modest fallback before layout. */
  min-height: 200px;
  animation: none;
  opacity: 1;
}
.ce-diagram-editor-preview .pop3d-charts {
  transition: none;
  opacity: 1;
}

.ce-diagram-bar-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.ce-diagram-bar-item .components-base-control { margin-bottom: 0.75rem; }
.ce-diagram-bar-item .components-base-control:last-child { margin-bottom: 0; }

.ce-diagram-bar-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.ce-diagram-bar-item-header strong { font-size: 0.9rem; }

.ce-diagram-layout-category { margin-top: 16px; }
.ce-diagram-layout-category:first-child { margin-top: 2px; }
.ce-diagram-layout-category-title {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #757575;
}

.ce-diagram-layout-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ce-diagram-layout-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 6px 2px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ce-diagram-layout-btn:hover { border-color: #999; background: #f5f5f5; }
.ce-diagram-layout-btn.is-active { background: #1e1e1e; color: #fff; border-color: #1e1e1e; }
.ce-diagram-layout-btn.is-active:hover { background: #333; border-color: #333; }

.ce-diagram-layout-btn .ce-diagram-layout-icon-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 80px;
  aspect-ratio: 1 / 1;
}
.ce-diagram-layout-btn.is-active .ce-diagram-layout-icon-img {
  filter: brightness(0) invert(1);
}
.ce-diagram-layout-btn-label {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}

.ce-diagram-maxh-scope {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  margin-top: 4px;
}
.ce-diagram-maxh-tab {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ce-diagram-maxh-tab:hover { border-color: #999; background: #f5f5f5; }
.ce-diagram-maxh-tab.is-active {
  background: #1e1e1e;
  color: #fff;
  border-color: #1e1e1e;
}
.ce-diagram-maxh-tab.is-active:hover { background: #333; border-color: #333; }

/* Import modal: wider than default WP modal (~750px). */
.components-modal__frame.pop3d-import-modal {
  width: min(1040px, 96vw) !important;
  max-width: 96vw !important;
}
.pop3d-import-modal__body {
  max-height: calc(92vh - 140px);
  overflow-y: auto;
}
.pop3d-import-modal__body .pop3d-import-preview-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}
