.scene-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-bottom: 1px solid #ddd8e4;
  background: #faf9fc;
  flex: 0 0 auto;
  overflow-x: auto;
}
.scene-tools button,
.scene-tools select,
#figureJobStatus button {
  border: 1px solid #d5cede;
  border-radius: 6px;
  background: white;
  padding: 5px 8px;
  color: #504665;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.scene-tools select {
  max-width: 155px;
}
.scene-tools button:disabled {
  opacity: 0.45;
  cursor: default;
}
.scene-tree {
  flex: 0 1 36%;
  min-height: 90px;
  max-height: 300px;
  overflow: auto;
  padding: 10px 8px;
  border-top: 1px solid #ddd8e4;
  background: #faf9fc;
}
.scene-tree > strong {
  display: block;
  font-size: 12px;
  padding: 3px 6px 8px;
}
.scene-tree button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 11px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #4a435a;
}
.scene-tree button:hover,
.scene-tree button.active {
  background: #e6e2f5;
  color: #514088;
}
.scene-inspector {
  overflow: auto;
  min-height: 0;
}
.scene-inspector textarea {
  width: 100%;
  resize: vertical;
  min-height: 45px;
  border: 1px solid #d7d0df;
  border-radius: 6px;
  padding: 7px;
  font:
    12px Arial,
    sans-serif;
  background: white;
}
.scene-inspector input[type="checkbox"] {
  width: 17px;
  height: 17px;
}
.scene-object-name {
  display: block;
  color: #9690a2;
  font-size: 12px;
  overflow-wrap: anywhere;
  margin: 6px 0 14px;
}
.scene-empty-inspector {
  font-size: 12px;
  line-height: 1.8;
  color: #797084;
  padding: 12px 0;
}
.scene-hit {
  cursor: move;
}
[data-connector-id] {
  cursor: pointer;
}
[data-connector-id] .scene-hit {
  cursor: pointer;
}
[data-resize-id] {
  cursor: nwse-resize;
}
.appearance-dialog {
  width: min(640px, 90vw);
  max-height: 85vh;
  overflow: auto;
  border: 1px solid #d5cede;
  border-radius: 12px;
  padding: 24px;
  color: #4a435a;
}
.appearance-dialog::backdrop { background: #17122566; }
.appearance-dialog h2 { margin: 0 0 12px; font-size: 18px; }
.appearance-dialog p { font-size: 13px; line-height: 1.6; }
.appearance-current { display: grid; justify-items: center; gap: 8px; padding: 12px; background: #f7f5fa; }
.appearance-dialog img { display: block; width: 100%; height: 110px; object-fit: contain; }
.appearance-candidates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.appearance-card { border: 1px solid #d5cede; border-radius: 8px; padding: 10px; background: white; overflow-wrap: anywhere; }
.appearance-card[aria-pressed="true"] { border-color: #6050a5; background: #ede9fb; outline: 2px solid #6050a5; }
.appearance-card span { display: block; margin-top: 8px; }
.appearance-actions { display: flex; justify-content: flex-end; gap: 10px; }
.appearance-actions button { border: 1px solid #d5cede; border-radius: 6px; padding: 8px 14px; }
.appearance-actions button:disabled { opacity: .5; cursor: default; }
.appearance-no-preview { display: grid; place-items: center; height: 110px; color: #797084; }
[data-resize-corner="ne"], [data-resize-corner="sw"] {
  cursor: nesw-resize;
}
[data-connector-id] {
  cursor: pointer;
}
#canvasViewport.scene-pan-ready,
#canvasViewport.scene-pan-ready * {
  cursor: grab !important;
}
#canvasViewport.scene-pan-dragging,
#canvasViewport.scene-pan-dragging * {
  cursor: grabbing !important;
}
#figureJobStatus:empty {
  display: none;
}
#figureJobStatus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid #ded8e8;
  margin-bottom: 8px;
  font-size: 12px;
  color: #594b74;
  text-align: center;
}
#figureJobStatus > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
#figureJobStatus button {
  flex-shrink: 0;
}
#figureJobStatus small {
  width: 100%;
  color: #856d68;
}
#sceneInspector .field {
  margin-top: 9px;
  margin-bottom: 9px;
}
#sceneInspector .button {
  font-size: 11px;
}
#sceneInspector .scene-review {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}
.asset-section {
  min-height: 80px;
}
.scene-tools .scene-import {
  margin-left: auto;
}
.scene-tools {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  border: 1px solid #d5cede;
  border-radius: 9px;
  max-width: calc(100% - 30px);
  box-shadow: 0 3px 12px #30204812;
}
.canvas-viewport > svg {
  margin-top: 116px;
}
.scene-tree {
  flex-shrink: 0;
}
.library-panel .asset-section.grow {
  flex: 0 1 80px;
  min-height: 30px;
}
.library-panel #systemAssetSection,
.library-panel #customAssetSection {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  min-width: 0;
  flex: 1 1 200px;
  min-height: 100px;
}
.scene-tree {
  max-height: 32%;
  flex-basis: 26%;
}

/* Independent vertical sidebar sections; hidden legacy entities must take no space. */
.library-panel { overflow-y: auto; }
.library-group { display: flex; flex-direction: column; min-height: 140px; flex: 1 1 0; border-bottom: 1px solid var(--line); }
#assetsGroup { flex-grow: 2; min-height: 240px; }
.library-group.is-collapsed, #assetsGroup.is-collapsed { flex: 0 0 auto; min-height: 0; }
.library-group-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; flex: 0 0 44px; padding: 0 16px; border: 0; background: transparent; text-align: left; font-weight: 700; font-size: 13px; }
.library-group-toggle:hover { background: #f3f0fa; }
.library-group-toggle:focus-visible { outline: 2px solid #8c79c7; outline-offset: -2px; }
.section-chevron { display: block; flex-shrink: 0; color: var(--muted); transition: transform .15s ease; }
.is-collapsed .section-chevron { transform: rotate(180deg); }
.library-group-content { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.library-group-content[hidden], .library-panel .asset-section[hidden] { display: none; }
#assetsContent > .search, #assetsContent > .library-tabs, #assetsContent > .upload-card { flex-shrink: 0; }
.library-panel #systemAssetSection, .library-panel #customAssetSection { min-height: 0; flex-basis: 0; padding-bottom: 2px; }
#assetsContent .upload-card { margin-top: 8px; margin-bottom: 10px; }
#sceneContent .scene-tree { flex: 1; min-height: 0; max-height: none; border-top: 0; }
#sceneContent .asset-section.grow { flex: 1; min-height: 0; }
#boardsContent .board-note { margin: 4px 16px 8px; }
#boardsContent .board-new { flex-shrink: 0; margin: 8px 16px 10px; }
