/* Stage 39.1: optional learning guidance in the existing template library. */
#tf-library-level {
  min-width: 145px;
  padding: 7px 10px;
  border: 1px solid #50657a;
  border-radius: 6px;
  background: #1b2a37;
  color: #e0eaf3;
}
#tf-library-level[hidden] { display: none; }
.template-level {
  display: inline-block;
  vertical-align: middle;
  padding: 2px 7px;
  border: 1px solid #587082;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .02em;
  color: #cddce8;
}
.template-level-beginner { border-color: #648c7d; color: #a9d9c4; }
.template-level-intermediate { border-color: #8d835f; color: #e2d39c; }
.template-level-advanced { border-color: #936f88; color: #e4b9d6; }

/* Stage 45: compact topic badges for curated templates. */
.template-category { display: inline-block; margin-left: 5px; padding: 1px 6px; border: 1px solid #5e7782; border-radius: 5px; color: #a9c8d5; font-size: 0.72em; white-space: nowrap; }

/* v30.3: numeric field on the left, slider sharing the same row. */
#node-properties .property-field-row--slider > input[type="number"] {
  flex: 0 1 92px;
  width: 92px;
  min-width: 64px;
}
#node-properties .property-field-row--slider > input[type="range"] {
  flex: 1 1 90px;
  width: 0;
  min-width: 48px;
  max-width: none;
}
@container (max-width: 220px) {
  #node-properties .property-field-row--slider { flex-wrap: wrap; }
  #node-properties .property-field-row--slider > input[type="range"] {
    flex-basis: 100%;
  }
}

/* Custom Node library toolbar: aligned controls, including hidden-node toggle. */
#tf-library-manage:not([hidden]) { align-items: center; gap: 12px; }
#tf-library-manage > label { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
#tf-library-manage > label > input[type="checkbox"] { margin: 0; }
#tf-library-manage > button { align-self: center; }

/* v30.5: script parameter cards keep number/boolean controls aligned. */
#node-properties .script-property-card { display:grid; gap:10px; min-width:0; padding:12px; margin:10px 0; border:1px solid var(--line, #394653); border-radius:8px; background:rgba(255,255,255,.025); }
#node-properties .script-property-header { display:flex; justify-content:space-between; align-items:center; gap:8px; }
#node-properties .script-property-header strong { font-size:12px; font-weight:600; }
#node-properties .script-property-header button { min-width:28px; height:28px; padding:2px 7px; }
#node-properties .script-property-field { display:flex; flex-direction:column; gap:5px; min-width:0; font-size:12px; }
#node-properties .script-property-field > span:first-child { opacity:.75; }
#node-properties .script-property-field > input:not([type=checkbox]),
#node-properties .script-property-field > select { width:100%; min-width:0; box-sizing:border-box; }
#node-properties .script-property-pair { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; align-items:end; }
#node-properties .script-property-checkline { display:flex; align-items:center; gap:8px; min-height:32px; padding:0 8px; border:1px solid var(--line, #394653); border-radius:5px; }
#node-properties .script-property-checkline input { width:auto; margin:0; }
#node-properties .script-property-exposure { display:flex; align-items:center; min-height:24px; }

/* v30.6: consistent Script Node inspector field and port spacing. */
#node-properties .script-resolution-field { display:flex; flex-direction:column; gap:6px; margin:12px 0; }
#node-properties .script-resolution-field > input { width:100%; box-sizing:border-box; }
#node-properties .script-controls,
#node-properties .script-controls ~ section { min-width:0; }
#node-properties .script-property-card { margin:12px 0; }
#node-properties .script-port-option { justify-content:flex-start; width:100%; box-sizing:border-box; }
#node-properties .script-port-option input[type=checkbox] { width:auto; flex:none; margin:0; }
#node-properties .script-property-field > input,
#node-properties .script-property-field > select { max-width:100%; }

/* v30.8: script resolution matches the standard slider + reset pattern. */
#node-properties .script-resolution-field > label { display:flex; flex-direction:column; gap:6px; }
#node-properties .script-resolution-field > label > input { width:100%; box-sizing:border-box; }
#node-properties .script-resolution-controls { display:flex; align-items:center; gap:8px; }
#node-properties .script-resolution-controls input[type=range] { flex:1; min-width:0; }
#node-properties .script-resolution-controls .property-reset { flex:none; }
#node-properties section > small + button { display:block; margin:10px 0 14px; }

/* v30.9: all inspector Add actions follow their editable items and span the panel. */
#props-panel #node-properties .property-add-button {
  display:block; box-sizing:border-box; width:calc(100% - 3px);
  max-width:calc(100% - 3px); margin:12px 0 4px 3px; min-width:0;
}
