/* 0.63.0: compact value, expose toggle and reset controls on one line. */
#node-properties .property-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
#node-properties .property-field-row > input:not([type="checkbox"]),
#node-properties .property-field-row > select {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
}
#node-properties .property-field-row > input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
}
#node-properties .property-field-row > button {
  flex: 0 0 auto;
  width: 30px;
  min-width: 30px;
  height: 29px;
  padding: 2px 6px;
  align-self: center;
  font-size: 14px;
}

.tf-library-overlay[hidden] {
  display: none;
}
.tf-library-overlay {
  position: fixed;
  inset: 0;
  z-index: 3500;
  background: #060b10d9;
  display: grid;
  place-items: center;
  padding: 20px;
}
.tf-library-dialog {
  width: min(850px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #192631;
  border: 1px solid #607d91;
  border-radius: 12px;
  box-shadow: 0 25px 80px #000b;
}
.tf-library-dialog > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #405669;
}
.tf-library-dialog > header strong {
  font-size: 18px;
}
.tf-library-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  background:#111b25;
  border-bottom:1px solid #405669;
}
.tf-library-tabs button {min-height:34px;padding:6px 14px;border:1px solid #344958;border-radius:6px;background:#202d38;color:#cbd5df;}
.tf-library-tabs button.active {
  border-color: #8dc7a3;
  background: #294a43;
  color: #dcf5e5;
  box-shadow:inset 0 -2px 0 #8dc7a3;
}
.tf-library-tools {
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.tf-library-tools > input {
  flex: 1;
  min-width: 200px;
}
.tf-library-tools > #tf-library-search {
  flex: 1 1 220px;
  width:220px;
  min-width:0;
}
#assets-library-actions {display:flex;align-items:center;gap:8px;flex:0 0 auto;}
#assets-import-json-control {display:flex;align-items:center;}
#assets-add-open,
#assets-import-json-control > button {
  box-sizing:border-box;
  min-height:32px;
  height:32px;
  white-space:nowrap;
}
#tf-library-modal.assets-mode .tf-library-tools {flex-wrap:nowrap;gap:8px;}
.tf-library-results {
  overflow: auto;
  padding: 0 20px 20px;
  min-height: 140px;
}
.tf-library-results .library-entry {
  margin-bottom: 8px;
}
.tf-library-results .library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
#tf-library-manage:not([hidden]) {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 0.67.4: wrap descriptions, pin actions to the right. */
.tf-library-results .library-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.tf-library-results .library-entry > div:first-child {
  flex: 1 1 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}
.tf-library-results .library-entry > div:first-child strong,
.tf-library-results .library-entry > div:first-child small {
  white-space: normal;
  overflow-wrap: anywhere;
}
.tf-library-results .library-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  margin-left: auto;
}
.tf-library-results .library-actions button {
  white-space: nowrap;
}
@media (max-width: 680px) {
  .tf-library-results .library-entry {
    align-items: flex-start;
  }
  .tf-library-results .library-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
.tf-template-dialog {
  width: min(540px, 96vw);
}
.tf-template-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}
.tf-template-form > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #cddce8;
}
.tf-template-form input,
.tf-template-form textarea,
.tf-template-form select {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
/* Checkbox rows must not inherit full-width text input styling. */
.tf-template-form > label.tf-template-visibility {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.tf-template-form input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #8dc7a3;
}
.tf-template-visibility-help {
  margin: -10px 0 0 26px;
  font-size: 12px;
  color: #9eafbd;
}
.tf-template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.curve-editor {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid #405260;
  border-radius: 8px;
  background: #1a252e;
}
.curve-editor h4 {
  margin: 0 0 4px;
  font-size: 13px;
}
.curve-editor .hint {
  font-size: 11px;
  color: #9aa8b7;
  margin: 0 0 9px;
}
.curve-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}
.curve-presets button {
  padding: 5px 8px;
  font-size: 11px;
}
.node-palette-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.node-palette-item > button:first-child {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.node-palette-item > .node-favorite-toggle {
  flex: 0 0 24px;
  width: 24px;
  min-width: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1;
  color: #aab8c4;
}
.node-palette-item > .node-favorite-toggle[aria-pressed="true"] {
  color: #ffdc83;
  background: #594522;
  border-color: #cda75a;
}
.reroute-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  font-size: 12px;
  cursor: pointer;
}
.reroute-switch input {
  width: auto;
  margin: 0;
  accent-color: #8dc7a3;
}
.reroute-off {
  border-style: dashed;
  opacity: 0.75;
}
.bypassed-node {
  opacity: 0.65;
  border-style: dashed;
}
.reroute-node {
  width: 120px;
  min-height: 45px;
}
.reroute-node .preview-toggle {
  display: none;
}
.wire-hit {
  pointer-events: stroke;
  cursor: crosshair;
}

#frames-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#frames-layer[hidden] {
  display: none;
}
.editor-frame {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid var(--frame-color);
  border-radius: 8px;
  background: color-mix(in srgb, var(--frame-color) 10%, transparent);
  pointer-events: none;
}
.editor-frame-head {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  background: color-mix(in srgb, var(--frame-color) 24%, #151d25);
  color: var(--frame-color);
  border-radius: 7px 7px 0 0;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.editor-frame-head span {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-frame-head button {
  padding: 2px 6px;
  min-width: 0;
  cursor: pointer;
}
.editor-frame-description {
  padding: 5px 10px;
  color: #a9b8c5;
  font-size: 12px;
  white-space: pre-wrap;
  overflow: hidden;
  max-height: 30px;
}
.editor-frame-grip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  pointer-events: auto;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(
    135deg,
    transparent 55%,
    var(--frame-color) 56%,
    transparent 65%,
    var(--frame-color) 70%,
    transparent 80%
  );
}
