/* One live materials widget, anchored to the viewport with a fixed edge rail. */
.workshop-dock{--dock-width:min(364px,calc(100vw - 42px));position:fixed;right:0;top:82px;bottom:18px;width:calc(var(--dock-width) + 34px);z-index:180;pointer-events:none;font-size:12px}
.workshop-dock-rail{position:absolute;right:0;top:0;width:34px;display:flex;flex-direction:column;gap:9px;pointer-events:auto}
.workshop-dock-rail>button{writing-mode:vertical-rl;display:flex;align-items:center;gap:7px;min-height:108px;padding:12px 7px;background:linear-gradient(100deg,#303a50,#182234);border:1px solid #c99c54;border-right:0;border-radius:9px 0 0 9px;color:#ffe3a0;font-size:12px;font-weight:650;box-shadow:0 3px 10px #0005}
.workshop-dock-rail>button[aria-expanded=true]{background:#56472b;color:#fff1cb}
.workshop-dock-content{width:var(--dock-width);height:100%;margin-right:34px;display:flex;flex-direction:column;overflow:hidden;pointer-events:auto;background:linear-gradient(150deg,#2e374a,#172032 70%);border:1px solid #c9a366;border-radius:12px 0 0 12px;box-shadow:-8px 10px 28px #0007;transform:translateX(calc(100% + 35px));opacity:0;visibility:hidden;transition:transform .24s cubic-bezier(.2,.8,.2,1),opacity .2s,visibility 0s .24s}
.workshop-dock[data-dock-open=true] .workshop-dock-content{transform:translateX(0);opacity:1;visibility:visible;transition-delay:0s}
.workshop-dock-materials{display:flex;flex-direction:column;flex:1;min-height:160px;overflow:hidden}
.workshop-dock header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 13px;border-bottom:1px solid #8e9bb044;flex:none;background:#10192955}
.workshop-dock h2{font-size:16px;letter-spacing:-.3px;display:flex;align-items:center;gap:8px}
.workshop-dock h2::before{content:'';width:23px;height:25px;display:block;flex:none;background:url('../../assets/interface/mesos-bag.png') center/contain no-repeat;image-rendering:pixelated}
.workshop-dock [data-dock-pin]{width:30px;height:29px;display:grid;place-items:center;flex:none;padding:5px;border:1px solid #7e8ba4;border-radius:6px;background:#29364a;color:#d3deee}
.workshop-dock [data-dock-pin] svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
.workshop-dock [data-dock-pin][aria-pressed=true]{color:#ffda7b;background:#6a512a;border-color:#eac36d}
.workshop-dock-actions{display:flex;gap:7px;padding:9px 12px;flex:none}
.workshop-dock-actions .btn{font-size:11px;padding:6px 9px}
.workshop-dock-scroll{overflow:auto;overscroll-behavior:contain;min-height:0;scrollbar-width:thin;scrollbar-color:#8190a7 #172032}
#craftDockMaterialsBody{padding:0 12px 12px;flex:1}
#craftDockStatus{color:var(--warning);padding:5px 12px 12px;line-height:1.5}
#craftDockStatus:empty{display:none}
.workshop-dock .atlas-collection-progress{margin:2px 0 8px;padding:8px;font-size:11px}
.workshop-dock .atlas-collection-progress small{font-size:9px}
.workshop-dock .atlas-material-totals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:8px 0;margin:0;font-size:9px}
.workshop-dock .atlas-material-totals>span{display:block;padding:0 5px;min-width:0}
.workshop-dock .atlas-material-totals b{display:block;font-size:19px}
.workshop-dock .atlas-material-preview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.workshop-dock .atlas-material-card{min-height:0;max-width:none;width:auto;padding:8px 5px;border-radius:8px;flex:initial}
.workshop-dock .atlas-material-card h3{font-size:10px;min-height:27px;line-height:1.3;letter-spacing:-.2px}
.workshop-dock .atlas-material-card>.craft-icon{width:31px;height:32px;margin:3px auto}
.workshop-dock .atlas-material-quantity{font-size:18px}
.workshop-dock .atlas-material-label,.workshop-dock .atlas-material-stock{font-size:9px}
.workshop-exclude-button{margin-top:7px;padding:3px 7px;min-height:24px;font-size:10px;line-height:1.4;color:#ecd9b5;border:1px solid #a28b65;border-radius:5px;background:#1c2638;flex:none}
.workshop-exclude-button:hover,.workshop-exclude-button:focus-visible{background:#57422b;color:#fff2ce;border-color:#ffcf75}
.workshop-dock .atlas-collected-materials{font-size:11px;margin-top:12px}
.workshop-dock-excluded{flex:none;max-height:48%;min-height:43px;border-top:1px solid #c5a066;display:flex;flex-direction:column;overflow:hidden}
.workshop-dock-excluded>header{padding:7px 11px}
#craftDockExcludeTitle{flex:1;text-align:left;border:0;background:none;font:inherit;font-weight:650;padding:5px 0;color:#f6d79e}
#craftDockExcludeTitle>span[aria-hidden]{display:inline-block;float:right;transition:transform .22s}
#craftDockExcludeTitle[aria-expanded=true]>span[aria-hidden]{transform:rotate(180deg)}
.workshop-dock-excluded-body{display:grid;grid-template-rows:0fr;min-height:0;opacity:0;visibility:hidden;transition:grid-template-rows .24s ease,opacity .2s,visibility 0s .24s}
.workshop-dock-excluded-body>div{overflow:hidden;min-height:0;display:flex;flex-direction:column}
.workshop-dock[data-excluded-open=true] .workshop-dock-excluded-body{grid-template-rows:1fr;opacity:1;visibility:visible;transition-delay:0s}
.workshop-dock-hint{font-size:11px;color:var(--text-secondary);margin:9px 12px;line-height:1.5}
#craftDockExcludedList{max-height:min(27dvh,235px);padding:0 11px}
.workshop-excluded-item{display:flex;align-items:center;gap:8px;padding:7px 6px;margin:5px 0;border:1px solid #987078;border-left:3px solid #d48b86;border-radius:7px;background:#4a2b383d}
.workshop-excluded-item img{width:27px;height:28px;object-fit:contain;image-rendering:pixelated;filter:grayscale(.8);opacity:.7;flex:none}
.workshop-excluded-item>span{flex:1;min-width:0;font-size:11px;line-height:1.3;color:#f0d8dd}
.workshop-excluded-item .btn{font-size:10px;padding:4px 6px}
#craftRestoreAll{margin:8px 12px;align-self:flex-start;font-size:11px;padding:5px 8px;flex:none}
.atlas-material-overview>.atlas-section-head{height:auto;min-height:56px;flex-wrap:wrap;gap:8px;padding-top:8px;padding-bottom:8px}
.atlas-material-overview>.atlas-section-head>h2{margin-right:auto}
#craftOpenExcluded,#craftOpenMaterials{font-size:11px;padding:6px 9px}

/* The tree is drawn from plan allocations, rather than a generated picture. */
.workshop-overview{width:min(1320px,96vw);max-width:96vw;max-height:92dvh;padding:0;border:1px solid #d3b478;border-radius:14px;background:#1c2638;color:var(--text-primary);box-shadow:0 20px 80px #000a;overflow:hidden}
.workshop-overview[open]{display:flex;flex-direction:column}
.workshop-overview::backdrop{background:#060b16c9}
.workshop-overview>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 20px;background:linear-gradient(120deg,#354057,#202a3c);border-bottom:1px solid #c19e5b77;flex:none}
.workshop-overview h2{font-size:22px}
.workshop-overview header p{font-size:11px;color:var(--text-secondary);margin:5px 0 0}
.workshop-tree-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 18px;border-bottom:1px solid var(--border);font-size:12px;flex:none}
.workshop-tree-toolbar label,.workshop-tree-toolbar>div{display:flex;align-items:center;gap:8px}
.workshop-tree-toolbar select{max-width:300px;min-width:0;border:1px solid #8390a7;background:#172234;color:var(--text-primary);padding:7px;border-radius:6px;font-size:12px}
.workshop-tree-toolbar .btn{padding:5px 10px}
#craftTreeZoom{font-size:11px;min-width:38px;text-align:center}
.workshop-tree-legend{display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;padding:9px 18px;font-size:11px;flex:none}
.workshop-tree-legend>span::before{content:'';display:inline-block;width:8px;height:8px;margin-right:5px;border-radius:3px;background:#e9bd65}
.workshop-tree-legend>[data-tree-kind=craft]::before{background:#bd9be8}.workshop-tree-legend>[data-tree-kind=owned]::before{background:#86c79a}.workshop-tree-legend>[data-tree-kind=gather]::before{background:#e6ac69}
.workshop-tree-legend small{margin-left:auto;color:var(--text-secondary);font-size:10px}
#craftTreeNotice{font-size:13px;padding:20px;color:var(--warning)}#craftTreeNotice:empty{display:none}
.workshop-tree-viewport{flex:1;height:56dvh;min-height:200px;overflow:auto;overscroll-behavior:contain;background:radial-gradient(#61718b40 1px,transparent 1px) 0 0/18px 18px,#131d2d;user-select:none;cursor:grab;scrollbar-width:thin}
.workshop-tree-viewport:active{cursor:grabbing}
.workshop-tree-viewport svg{display:block;font-family:inherit}
.workshop-tree-edge{fill:none;stroke:#8593a9;stroke-width:1.7;opacity:.8}
.workshop-tree-edge-label{fill:#d6dfed;font-size:10px;paint-order:stroke;stroke:#131d2d;stroke-width:3px;stroke-linejoin:round}
[data-tree-node]{cursor:pointer;outline:none}
[data-tree-node]>rect{fill:#263449;stroke:#8292ab;stroke-width:1.5}
[data-tree-node][data-tree-kind=goal]>rect{fill:#423a29;stroke:#e7be6d}
[data-tree-node][data-tree-kind=craft]>rect{fill:#302d46;stroke:#b9a0dc}
[data-tree-node][data-tree-kind=owned]>rect{fill:#253d35;stroke:#84c7a0}
[data-tree-node][data-tree-kind=gather]>rect{fill:#3c3528;stroke:#d8af76}
[data-tree-node]:hover>rect,[data-tree-node]:focus-visible>rect{stroke:#fff0bd;stroke-width:3}
[data-tree-node] image{image-rendering:pixelated}
.workshop-tree-name{fill:#f3f5fc;font-size:12px;font-weight:600}
.workshop-tree-quantity{fill:#ffdb82;font-size:15px;font-weight:750}
.workshop-tree-subtitle{fill:#cad5e6;font-size:10px}
.workshop-tree-detail{display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;padding:12px 18px;font-size:12px;border-top:1px solid var(--border);flex:none}
.workshop-tree-detail:empty{display:none}.workshop-tree-detail>strong{color:#ffe0a0}.workshop-tree-detail>span{flex:1;color:var(--text-secondary)}
.workshop-tree-exclusions{padding:9px 18px;border-top:1px solid var(--border);font-size:12px;max-height:135px;overflow:auto;flex:none}
.workshop-tree-exclusions>summary{cursor:pointer;color:#e1bdc0;padding:4px 0}
#craftTreeExcluded{display:flex;flex-wrap:wrap;gap:7px;padding-top:8px}#craftTreeExcluded .btn{font-size:11px;padding:5px 8px}
@media(min-width:1600px){body[data-tool=crafting].workshop-dock-pinned .atlas-layout,body[data-tool=crafting].workshop-dock-pinned .atlas-secondary{margin-right:412px}}
@media(max-width:650px){.workshop-dock{top:72px;bottom:10px}.workshop-dock-rail>button{min-height:96px}.workshop-overview{max-height:94dvh}.workshop-overview>header{padding:12px 14px}.workshop-overview h2{font-size:19px}.workshop-tree-toolbar{padding:9px 12px;gap:8px}.workshop-tree-toolbar select{max-width:220px}.workshop-tree-legend{padding:8px 12px;gap:6px 10px}.workshop-tree-legend small{width:100%;margin:0}.workshop-tree-viewport{min-height:160px;height:45dvh}.workshop-tree-detail{padding:10px 12px}}
@media(prefers-reduced-motion:reduce){.workshop-dock-content,.workshop-dock-excluded-body,#craftDockExcludeTitle>span[aria-hidden]{transition:none}}

.workshop-dock{overflow:hidden}.workshop-tree-viewport{min-width:0;max-width:100%}.workshop-tree-detail>strong,.workshop-tree-detail>span{min-width:0;overflow-wrap:anywhere}

/* One centered grip travels with the whole drawer, including its handle. */
.workshop-dock{top:50%;bottom:auto;height:min(82dvh,780px);transform:translate(calc(100% - 34px),-50%);transition:transform .26s cubic-bezier(.2,.8,.2,1);overflow:clip}
.workshop-dock[data-dock-open=true]{transform:translate(0,-50%)}
.workshop-dock-rail{left:0;right:auto;top:50%;transform:translateY(-50%);width:34px}
.workshop-dock-rail>button{writing-mode:horizontal-tb;display:flex;align-items:center;justify-content:center;gap:4px;min-height:76px;width:34px;padding:10px 6px;border:1px solid #d9b56a;border-right:0;border-radius:9px 0 0 9px}
.workshop-dock-rail>button>span{display:block;width:2px;height:22px;background:#f7d791;border-radius:2px;flex:none}
.workshop-dock-content,.workshop-dock[data-dock-open=true] .workshop-dock-content{margin-left:34px;margin-right:0;border-radius:12px 0 0 12px;transform:none;opacity:1;visibility:visible;transition:none}
@media(max-width:650px){.workshop-dock{top:50%;bottom:auto;height:min(80dvh,780px)}}
@media(prefers-reduced-motion:reduce){.workshop-dock{transition:none}}
