/* Correct .92 auto-placement. The drag handle remains absolutely positioned;
   it must not reserve a grid column. Keep the existing shell and colour tokens. */
.d53-studio .d53-category-record {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  gap: 16px;
}
.d53-studio .d53-category-fields {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: end;
}
.d53-studio .d53-category-meta {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
.d53-studio .d53-category-meta .d53-portal-matrix {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.d53-studio .d53-category-fields > .d53-lock { align-self: center; }
.d53-studio .d53-category-fields > label { overflow-wrap: anywhere; }

/* One consistent editing surface, regardless of the selected portal's number
   of groups. These rules do not affect the runtime sidebar or its categories. */
.d53-studio .d53-editor-workspace .d53-canvas {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  align-items: start;
}
.d53-studio .d53-live-layout { min-width: 0; }
.d53-studio .d53-group { min-width: 0; }
.d53-studio .d53-group > header {
  grid-template-columns: 20px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
}
.d53-studio .d53-group > header > .d53-handle { grid-column:1; grid-row:1; }
.d53-studio .d53-group > header > input { grid-column:2; grid-row:1; width:100%; box-sizing:border-box; }
.d53-studio .d53-group > header > select {
  grid-column:2; grid-row:2; width:100%; min-width:0; min-height:36px;
  box-sizing:border-box; padding:7px; font:inherit; color:inherit;
  border:1px solid var(--r52-border,var(--line)); border-radius:7px;
  background:var(--r52-panel,#fff);
}
.d53-studio .d53-group > header > span:not(.d53-handle) { grid-column:3; grid-row:2; }
.d53-studio .d53-group > header > button { grid-column:3; grid-row:1; justify-self:end; }
.d53-studio .d53-card > div { min-width:0; overflow-wrap:anywhere; }
.d53-studio .d53-inspector { min-width:0; box-sizing:border-box; }
@media(max-width:1450px){
  .d53-studio .d53-live-layout { grid-template-columns:minmax(0,1fr); }
  .d53-studio .d53-inspector { position:static; }
}
@media(max-width:1120px){
  .d53-studio .d53-editor-workspace .d53-canvas { grid-template-columns:minmax(0,1fr); }
}
