.pack-head,.path-head,.path-footer,.path-actions,.path-legend,.project-title {
  display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;
}
.pack-head,.path-head,.path-footer {justify-content:space-between}
.pack-title small {color:#5a655f}
#panelBody .pack-title h3,#panelBody .path-head h3 {margin:0}
body[data-menu=inventory] #panelBody {background:#f0eee3}
.pack-head select,.goal-picker select {max-width:100%;min-width:0}
.pack-head select {width:auto}
body:is([data-menu=inventory],[data-menu=research]) #tabs {flex:none}
.pack-grid {
  display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,108px),1fr));
  gap:6px;padding:.55rem;margin:.8rem 0 .1rem;border:1px solid #6f7970;border-radius:.45rem;
  background:#293634;box-shadow:inset 0 2px 7px #111b1c80;align-items:start;
}
.pack-slot {
  position:relative;min-width:0;padding:0;overflow:hidden;border-radius:4px;border:1px solid #586762;
  background:#283532;box-shadow:inset 1px 1px #e0d7b826,1px 2px 1px #111917;
}
.pack-slot:hover,.pack-slot:focus-within {border-color:#e4bd7d}
#panelBody .pack-slot h3 {display:block;margin:0}
#panelBody .pack-face {
  display:flex;min-width:0;width:100%;flex-direction:column;align-items:center;justify-content:space-between;
  border:0;border-radius:0;margin:0;padding:.48rem .25rem .32rem;cursor:grab;color:#f3f0dc;
  background:radial-gradient(ellipse at 50% 35%,#485852 0%,#2e3c39 75%);
}
#panelBody .pack-face:hover {background:radial-gradient(ellipse at 50% 35%,#586459,#3b4940)}
#panelBody .pack-face .item-icon {width:clamp(48px,6vw,71px);height:clamp(48px,6vw,71px);pointer-events:none}
.pack-count {
  position:absolute;pointer-events:none;top:.23rem;right:.3rem;color:#fff3ce;background:#1b2423df;
  border-radius:3px;padding:0 .18rem;font:600 .73rem/1.35 var(--sans);font-variant-numeric:tabular-nums;
}
.pack-name {font:600 .78rem/1.15 var(--sans);overflow-wrap:anywhere;min-height:2.3em;display:grid;align-items:center}
#panelBody .pack-slot select,#panelBody .pack-slot>button {
  display:block;margin:0;width:100%;min-width:0;padding:.23rem .3rem;font:400 .72rem/1.2 var(--sans);
  color:#ddd9c7;border:0;border-radius:0;border-top:1px solid #64716888;background:#26312f;
}
#panelBody .pack-slot>button:disabled {color:#afbaae}
.path-panel {margin:.8rem 0 1.3rem;border:1px solid #586962;border-radius:.45rem;overflow:hidden;background:#1d2a2b}
.path-head,.path-footer {padding:.65rem .9rem;color:#f6eddb;background:#233334}
#panelBody .path-head h3 {font-size:1.25rem;color:#f2ead7}
.path-counter,.goal-picker {font:400 .76rem/1.4 var(--sans);color:#c2d1c9}
.goal-picker {display:flex;gap:.4rem;align-items:center;min-width:0}
#panelBody .goal-picker select {padding:.32rem;background:#162427;color:#f1eddf;border:1px solid #6d817b}
.path-scroll {
  position:relative;overflow:auto;max-height:clamp(165px,33vh,310px);overscroll-behavior:contain;
  background-color:#192626;background-image:radial-gradient(#6e837852 .8px,transparent .9px);
  background-size:12px 12px;scrollbar-color:#74857c #1b2828;
}
.path-board {position:relative;isolation:isolate}
.path-era {position:absolute;top:9px;color:#d3c29f;font:600 .7rem/1.3 var(--sans);letter-spacing:.025em}
#panelBody .path-wires {position:absolute;inset:0;display:block;width:100%;height:100%;max-width:none;pointer-events:none}
.path-wires marker path {stroke:none}
.path-wires>path {fill:none;stroke:#82928a;stroke-width:1;opacity:.38}
.path-wires>path.met {stroke:#91c4a0;opacity:.6}
.path-wires>path.incident {stroke:#f7d498;stroke-width:2;opacity:1}
#panelBody .path-node {
  position:absolute;display:flex;align-items:center;gap:6px;padding:4px 6px;margin:0;text-align:left;
  border:1px solid #65736e;border-left:3px solid #819190;border-radius:4px;color:#ecf0e8;background:#2b3839;
  box-shadow:0 2px 4px #111a1c6b;line-height:1.15;
}
#panelBody .path-node[data-status=ready] {border-left-color:#f2c677;background:#474638}
#panelBody .path-node[data-status=done] {border-left-color:#90cda5;background:#293f37}
#panelBody .path-node[aria-pressed=true] {outline:2px solid #edce91;outline-offset:1px}
#panelBody .path-node:hover {filter:brightness(1.13)}
.path-node .item-icon {width:34px;height:34px}
.path-node-name {hyphens:auto;font:600 .74rem/1.15 var(--sans);overflow-wrap:anywhere}
.path-node-name small {display:block;margin-top:.16rem;color:#c3cfc4;font:400 .64rem/1 var(--sans)}
.path-footer {border-top:1px solid #53615a;font-size:.72rem}
.path-legend {gap:.7rem}
.path-legend span:before {content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:#98a9a9;margin-right:.28rem}
.path-legend [data-status=ready]:before {background:#f2c677}
.path-legend [data-status=done]:before {background:#90cda5}
#panelBody .path-actions button {font-size:.75rem;padding:.28rem .55rem;border:1px solid #768077;background:#2e403e;color:#f1e8cf}
.path-detail {background:#e2e6d9;padding:.5rem}
.path-detail .project-card {margin:0}
.project-title {flex-wrap:nowrap;gap:.6rem}
.project-title .item-icon {width:45px;height:45px;background-color:#394741;border-radius:6px}
#panelBody .project-title h3 {margin:.25rem 0}
@media(max-width:680px){
  #panelBody .pack-grid {grid-template-columns:repeat(auto-fill,minmax(min(100%,83px),1fr));padding:4px;gap:4px}
  #inventoryRail #hotbar .item-icon {display:inline-block;flex:none;width:21px;height:21px}
  #inventoryRail #hotbar button:has(.item-icon) .slot-label {position:absolute;clip-path:inset(50%);height:1px;width:1px;overflow:hidden}
  .path-head,.path-footer {padding:.5rem;gap:.4rem}
  .goal-picker {flex-wrap:wrap}
  body[data-menu=research] #tabs {flex-wrap:nowrap;overflow-x:auto}
}
