/* RC10: permanent hierarchy, separate from the existing machine palette. */
.fd-structure-dialog{background:#302931;color:#eee3ef;border:1px solid #817041;border-radius:12px;width:min(460px,90vw);padding:24px}
/* Keep legacy designer controls in the charcoal and amber workspace palette. */
html.quiet-c #fdHarvestPortal{background:var(--panel);border-color:var(--border);color:var(--text)}
html.quiet-c #fdHarvestPortal button,
html.quiet-c #designerBody .fd-harvest-row button,
html.quiet-c #fdInspectBody .fd-inspect-qty button,
html.quiet-c #designerBody .fd-edge-row button{background:var(--panel3);border-color:var(--border);color:var(--text)}
html.quiet-c #fdHarvestPortal button:hover,
html.quiet-c #designerBody .fd-harvest-row button:hover,
html.quiet-c #fdInspectBody .fd-inspect-qty button:hover,
html.quiet-c #designerBody .fd-edge-row button:hover{border-color:var(--amber);color:var(--amber)}
html.quiet-c #fdHarvestPortal small,
html.quiet-c #designerBody .fd-harvest-summary,
html.quiet-c #designerBody .fd-side-hint{color:var(--muted)}
html.quiet-c #designerBody .fd-harvest-summary strong,
html.quiet-c #fdInspectBody .fd-inspect-line.emphasis{color:var(--amber)}
html.quiet-c #designerBody .fd-edge-list,
html.quiet-c #designerBody .fd-edge-row,
html.quiet-c #fdInspectBody .fd-inspect-line{border-color:var(--border)}
html.quiet-c #designerBody .fd-work-node .fd-port{background:var(--panel3);border-color:var(--border);color:var(--text)}
html.quiet-c #designerBody #fdArrow-material path{fill:var(--amber)}
html.quiet-c #designerBody #fdArrow-water path{fill:var(--muted)}
html.quiet-c #designerBody #fdArrow-power path{fill:var(--red)}
.fd-structure-dialog::backdrop{background:#000a}
.fd-structure-dialog h3{margin:0 0 16px;color:#e8c448}
.fd-structure-dialog p{font-size:14px;line-height:1.6}
.fd-structure-dialog label{display:block;font-size:13px}
.fd-structure-dialog input{display:block;width:100%;box-sizing:border-box;background:#211c24;border:1px solid #5b4e5e;color:#f4e9f6;border-radius:6px;padding:10px;margin:8px 0 20px;font:inherit}
.fd-structure-dialog form>div{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
#designerBody .fd-structure-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:16px;align-items:start;min-width:0}
#designerBody .fd-structure-layout.tree-collapsed{grid-template-columns:44px minmax(0,1fr)}
#designerBody .fd-factory-tree{position:sticky;top:12px;background:#28232a;border:1px solid #49404b;border-radius:10px;padding:10px;max-height:80vh;overflow:auto;min-width:0}
#designerBody .fd-factory-tree header{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-bottom:12px;color:#e8c448;font-size:11px;letter-spacing:1px}
#designerBody .fd-factory-tree button{font:inherit;cursor:pointer;background:transparent;color:#ddd4df;border:0;border-radius:5px;padding:8px;text-align:left;line-height:1.3;overflow-wrap:anywhere}
#designerBody .fd-factory-tree header button{font-size:18px;padding:3px}
#designerBody .fd-tree-content>button{display:block;width:100%}
#designerBody .fd-tree-branch>div:first-child{display:flex;align-items:center}
#designerBody .fd-tree-branch>div:first-child>[data-fd-nav]{flex:1;min-width:0}
#designerBody .fd-tree-lines{padding-left:20px}
#designerBody .fd-tree-lines>button{display:block;width:100%;font-size:12px}
#designerBody .fd-factory-tree button:hover{background:#3c343f}
#designerBody .fd-factory-tree [aria-current="page"]{background:#4a402c;color:#f2d35e;border-left:3px solid #e8c448}
#designerBody .fd-tree-content label{display:block;font-size:11px;margin-top:20px;color:#b9acbc}
#designerBody .fd-tree-content select{width:100%;margin-top:6px;background:#302a33;color:#eee3ef;border:1px solid #5b4e5e;border-radius:5px;padding:8px}
#designerBody .fd-tree-content>small{display:block;font-size:10px;color:#aa9caf;padding:8px}
#designerBody .tree-collapsed .fd-tree-content,#designerBody .tree-collapsed .fd-factory-tree header b{display:none}
#designerBody .fd-structure-main{min-width:0}
#designerBody .fd-structure-main>.fd-work-stats>div:last-child{display:block!important}
#fdChainWorkspace label:has(>#fdProduct){display:none!important}
#designerBody .fd-breadcrumb{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:10px}
#designerBody .fd-breadcrumb button{background:none;border:0;color:#e8c448;font-size:15px;cursor:pointer;padding:7px 3px;overflow-wrap:anywhere}
#designerBody .fd-breadcrumb [aria-current="page"]{color:#f3eaf4;font-weight:700}
#designerBody .fd-structure-actions{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px}
#designerBody .fd-build-summary{border:1px solid #998142;border-top:3px solid #e8c448;border-radius:10px;background:#302931;margin:12px 0 24px;padding:20px;color:#f0e6f2}
#designerBody .fd-build-summary>header{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:20px}
#designerBody .fd-build-summary header span{font-size:10px;letter-spacing:2px;color:#d3b854}
#designerBody .fd-build-summary h3{font-size:22px;margin:5px 0}
#designerBody .fd-build-summary header strong{font-size:32px;color:#e8c448;text-align:right}
#designerBody .fd-build-summary header small{display:block;font-size:11px;color:#c4b7c7;font-weight:400}
#designerBody .fd-build-categories{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:24px}
#designerBody .fd-build-categories h4{font-size:11px;letter-spacing:1px;color:#cdbbd0;border-bottom:1px solid #534758;padding-bottom:10px}
#designerBody .fd-build-item{border-bottom:1px solid #453a49;padding:8px 0}
#designerBody .fd-build-item summary{display:flex;justify-content:space-between;gap:10px;cursor:pointer;font-size:13px}
#designerBody .fd-build-item summary span:before{content:'▸ ';color:#e8c448}
#designerBody .fd-build-item[open] summary span:before{content:'▾ '}
#designerBody .fd-build-item summary small{font-size:10px;color:#b4a0ba}
#designerBody .fd-build-item summary b{font-size:17px;color:#e8c448}
#designerBody .fd-build-item p{display:flex;justify-content:space-between;gap:8px;font-size:12px;padding-left:14px;color:#bfaec5}
#designerBody .fd-build-summary>.note{margin:18px 0 0;font-size:11px}
#designerBody .fd-shared-panel{border:1px solid #514457;background:#302931;border-radius:10px;padding:20px;max-width:650px}
#designerBody .fd-shared-panel .fd-harvest-row{margin:12px 0}
/* Harvest has a dedicated tree entry and an editor on its canvas node. */
html.quiet-c #fdPalette{display:none}
html.quiet-c[data-qi-page="designer"] #qiDesignerDetails{grid-template-columns:minmax(0,1fr)}
html.quiet-c #qiDesignerDetails[data-fd-view="factory"]{display:none}
@media(max-width:850px){#designerBody .fd-structure-layout{grid-template-columns:170px minmax(0,1fr);gap:10px}#designerBody .fd-build-summary{padding:14px}#designerBody .fd-build-summary>header{align-items:flex-start}#designerBody .fd-build-summary h3{font-size:18px}}
@media(max-width:560px){#designerBody .fd-structure-layout{grid-template-columns:minmax(0,1fr)}#designerBody .fd-factory-tree{position:static;max-height:260px}#designerBody .fd-structure-layout.tree-collapsed{grid-template-columns:minmax(0,1fr)}#designerBody .tree-collapsed .fd-factory-tree{padding:3px 10px}#designerBody .fd-build-summary>header{flex-wrap:wrap}#designerBody .fd-build-summary header strong{text-align:left}}
