/* 307ea — Subject PANEL ONLY.
 * Object source: 36px rows; 5px before level 1; zero gap before deeper rows.
 * Keep 307dw indentation/weights, 307dy selected surface, 307dz event logic.
 */
html body.atosy-view-subject #subject-full-page #subject-classification-panel
#subject-classification-tree,
html body.atosy-view-subject #subject-full-page #subject-classification-panel
#subject-classification-tree .subject-classification-children:not([hidden]):not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
html body.atosy-view-subject #subject-full-page #subject-classification-panel
#subject-classification-tree .subject-classification-node {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  flex: 0 0 auto !important;
}
html body.atosy-view-subject #subject-full-page #subject-classification-panel
#subject-classification-tree .subject-classification-node[data-subject-level]
> .subject-classification-row {
  box-sizing: border-box !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  margin: 0 !important;
}
html body.atosy-view-subject #subject-full-page #subject-classification-panel
#subject-classification-tree .subject-classification-node[data-subject-level="1"]
> .subject-classification-row {
  margin-top: 5px !important;
}
/* Reserve action space from the first layout. No display:none and no overlay.
   IDs below belong exclusively to the Subject classification panel. */
html body #atosy-category-manager-btn,
html body #atosy-subject-all-fixed-307db,
html body #subject-full-page #subject-classification-panel
#atosy-classification-fixed-v4 #atosy-category-manager-btn,
html body #subject-full-page #subject-classification-panel
#atosy-classification-fixed-v4 #atosy-subject-all-fixed-307db {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
  animation: none !important;
}
/* The existing native-pending flag wins immediately, also on revisiting Subject. */
html body.atosy-view-subject:not(.atosy-subject-native-pending)
#subject-full-page:not(.hidden):not([hidden])
#subject-classification-panel[data-actions-ready-307ea="1"]
#atosy-classification-fixed-v4 #atosy-category-manager-btn,
html body.atosy-view-subject:not(.atosy-subject-native-pending)
#subject-full-page:not(.hidden):not([hidden])
#subject-classification-panel[data-actions-ready-307ea="1"]
#atosy-classification-fixed-v4 #atosy-subject-all-fixed-307db {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}


/* 307em — TWO ACTIONS FINAL
   Only Subject's Add and Category Edit buttons.
   Both use the existing 307ea readiness signal. */

html body #subject-full-page #subject-full-add {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
  animation: none !important;
}

html body.atosy-view-subject:not(.atosy-subject-native-pending)
#subject-full-page.subject-object-native:not(.hidden):not([hidden])
#subject-full-add {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html body.atosy-view-subject:not(.atosy-subject-native-pending)
#subject-full-page.subject-object-native:not(.hidden):not([hidden]):has(#subject-classification-panel[data-actions-ready-307ea="1"])
#subject-full-add {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
