/* Give the editor a bounded height so its two panes scroll independently. */
@media (min-width: 901px) {
  body:has(#edit-field-doc-category) .dialog-off-canvas-main-canvas {
    overflow: hidden !important;
  }

  body:has(#edit-field-doc-category) .layout-form {
    height: calc(100vh - 190px) !important;
    min-height: 360px !important;
    flex: 0 0 auto !important;
  }

  body:has(#edit-field-doc-category) .layout-region--main,
  body:has(#edit-field-doc-category) .layout-region--secondary {
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
  }
}

/* Keep document card actions on one line on narrow admin screens. */
@media (max-width: 700px) {
  html body .docs-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  html body .docs-grid .doc-card {
    flex: 0 0 calc(50% - 3px) !important;
    width: calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  html body .doc-card-foot {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }
  html body .doc-card-foot .doc-langs {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
  }
  html body .doc-card-foot .button {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 560px) {
  html body .docs-grid .doc-card {
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
