/* Reuse the tree compact-control grid and restrained active colors. */
.tree-label-intent-source { display: none !important; }
.tree-annotation-menu .tree-visibility-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px; }
.tree-visibility-row .tree-setting-button-controls { display: flex; gap: 3px; }
.tree-annotation-headings { display: flex; align-items: center; gap: 4px; }
.tree-annotation-headings label { display: flex; flex: 1; align-items: center; white-space: nowrap; }
.tree-annotation-color-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 3px; align-items: center; }
.tree-annotation-color-row label { display: flex; align-items: center; white-space: nowrap; }
.tree-annotation-color-row select { width: 100%; min-width: 0; padding: 3px; font: inherit; font-size: 10px; border: 1px solid #cfdae6; border-radius: 4px; background: #fff; }
.cm-popup-window { resize: both; overflow: auto; min-width: 220px; min-height: 100px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
.cm-popup-move { cursor: move; touch-action: none; user-select: none; }
.cm-popup-resize svg { display: block; width: 100%; height: 100%; color: #6f829b; pointer-events: none; }
.cm-popup-window > footer { padding-right: 20px !important; }
.cm-popup-window .cm-popup-resize { position: absolute; right: 1px; bottom: 1px; width: 14px; height: 14px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: linear-gradient(135deg,transparent 46%,#91a4b8 47%,#91a4b8 54%,transparent 55%,transparent 68%,#91a4b8 69%,#91a4b8 76%,transparent 77%); cursor: nwse-resize; touch-action: none; }
.tree-annotation-menu.cm-popup-window { width: 236px; padding: 5px 5px 10px; font-size: 11px; }
.tree-annotation-menu.cm-popup-window label { min-height: 24px; padding: 3px 5px; gap: 6px; }
.tree-annotation-menu.cm-popup-window .tree-popover-heading { padding: 3px 5px 5px; }
.tree-annotation-menu.cm-popup-window .tree-annotation-color-row { grid-template-columns: 101px minmax(0,1fr); }
.tree-annotation-row { display: flex; align-items: center; gap: 3px; min-width: 0; }
.tree-annotation-row > label { flex: 1; min-width: 0; margin: 0; }
.tree-annotation-headings > .tree-annotation-row { flex: 1; }
.tree-annotation-menu.cm-popup-window .tree-annotation-color-row { display: grid; grid-template-columns: 97px minmax(0,1fr) 22px; }
.tree-annotation-menu .tree-annotation-settings { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; min-height: 0; padding: 3px; border: 0; border-radius: 4px; background: transparent; color: #536a83; cursor: pointer; }
.tree-annotation-menu .tree-annotation-settings:hover { background: #e5eef9; color: #1859a5; }
.tree-annotation-menu .tree-annotation-settings .ui-icon { width: 14px; height: 14px; }
.tree-recipe-dialog { width: min(430px,calc(100vw - 24px)); padding: 12px; border: 1px solid #cfdced; border-radius: 8px; }
.tree-recipe-dialog p { font-size: 12px; line-height: 1.45; }
.tree-recipe-dialog footer { display: flex; gap: 6px; justify-content: flex-end; }

.tree-recipe-dialog.cm-action-dialog { width: min(760px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.tree-recipe-dialog [data-recipe-linkage] { position: relative; max-height: min(52dvh,440px); overflow: auto; margin: 8px 0; }
.tree-recipe-dialog #metadataLinkPanel { position: static !important; inset: auto !important; width: auto !important; max-width: 100%; min-width: 0; transform: none !important; box-shadow: none; margin: 0; }
.tree-recipe-dialog > footer { position: relative; z-index: 1; padding-top: 8px; border-top: 1px solid #d4e1f0; background: var(--panel,#fff); }

.tree-setting-mixed-label { flex: 0 0 auto; align-self: center; padding: 0 4px; white-space: nowrap; color: #6b7f98; font-size: 10px; }
.tree-setting-mixed-label[hidden] { display: none !important; }


/* One master row: label, visibility choices and disclosure in the input column. */
body #app #tab-appearance.tree-settings.control-page.figure-settings.unified-settings .tree-setting-toggle-head { display: block !important; padding: 0 !important; background: transparent !important; }
body #app #tab-appearance.tree-settings.control-page.figure-settings.unified-settings .tree-setting-toggle-head > .tree-setting-master-row { width: 100% !important; margin: 0 !important; }
body #app #tab-appearance.tree-settings .tree-setting-master-row .setting-detail-toggle { display: inline-flex !important; align-items: center; justify-content: center; flex: 0 0 auto; width: auto !important; min-width: 42px !important; height: 24px !important; margin: 0 !important; padding: 2px 4px !important; border: 0 !important; background: transparent !important; color: #526d91; white-space: nowrap; }
body #app #tab-appearance.tree-settings .tree-setting-master-row .setting-detail-toggle:disabled { color: #9aa6b5; opacity: .65; cursor: default; }
body #app #tab-appearance.tree-settings .tree-setting-master-row .setting-detail-toggle:not(:disabled):hover { background: #edf3fb !important; }
body #app #tab-appearance.tree-settings :is(.settings-module,.nested-setting).is-disabled:has(> .tree-setting-toggle-head) { opacity: 1; }
