/* Edit drawers open full width; the size button restores each drawer's
   original width without replacing any form or changing modal behavior. */
@media (min-width: 821px) {
  dialog[data-editor-size="full"] {
    inset: 0;
    /* Override ID-based compact widths used by key, user and code editors. */
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    border-left: 0;
  }
}

/* Use the extra editing space for short fields and independent supplier
   mappings. Long prose and request JSON keep the complete content width. */
@media (min-width: 1280px) {
  dialog[data-editor-size="full"] .provider-field-grid:has(> :nth-child(3)) {
    grid-template-columns: repeat(3,minmax(0,1fr));
    align-items: start;
  }
  dialog[data-editor-size="full"] .provider-field-grid > :is(.provider-field-grid,:has(textarea)) {
    grid-column: 1 / -1;
  }
  dialog[data-editor-size="full"] #channel-model-mapping-list {
    grid-template-columns: repeat(2,minmax(0,1fr));
    align-items: start;
    gap: 20px;
  }
  dialog[data-editor-size="full"] #channel-model-mapping-list > :only-child {
    grid-column: 1 / -1;
  }
  dialog[data-editor-size="full"] #channel-model-mapping-list > .channel-supplier-mappings {
    min-width: 0;
  }
  dialog[data-editor-size="full"] .provider-field-grid > * { min-width: 0; }
}

@media (min-width: 1680px) {
  dialog[data-editor-size="full"] .model-description-locale-grid {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }
}

dialog[data-editor-size] :is(.provider-editor-header,.customer-group-drawer-header) { column-gap: 10px; }
dialog[data-editor-size] :is(.provider-editor-title,.customer-group-drawer-title) { margin-right: auto; }
dialog[data-editor-size] .editor-size-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #525252;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}
dialog[data-editor-size] .editor-size-toggle:hover { border-color: #cbd5e1; background: #f8fafc; color: #171717; }
dialog[data-editor-size] .editor-size-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
dialog[data-editor-size] .editor-size-toggle svg { flex: 0 0 16px; width: 16px; height: 16px; }
dialog[data-editor-size="full"] .editor-expand-icon,
dialog[data-editor-size="drawer"] .editor-panel-icon { display: none; }

/* Mobile drawers already fill the usable viewport. Keep mobile-layout.css in
   charge of keyboard height, scrolling and close-button reachability. */
@media (max-width: 820px) {
  dialog[data-editor-size] .editor-size-toggle { display: none; }
}
