/* Line diagram and blueprint-related styles. Split from styles.css. */

.blueprint-panel {
  position: relative;
}


.blueprint-heading {
  justify-content: flex-start;
}

.blueprint-heading-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.blueprint-heading .panel-actions {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: 0;
}

.blueprint-heading .display-rate-control {
  margin-left: auto;
  order: 20;
}

.blueprint-heading #facilityOverlayButton,
.blueprint-heading #recipeTracerButton,
.blueprint-heading #byproductAuditButton {
  order: 1;
  display: none;
}

.blueprint-insight-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(128px, 1fr));
  gap: 5px;
  flex: 1 1 auto;
  min-width: 320px;
  max-width: min(1320px, 100%);
  order: 1;
}


.blueprint-insight-cards .insight-dock-card {
  min-height: 42px;
  padding: 5px 6px;
}

.blueprint-insight-cards .insight-dock-card strong {
  font-size: 12px;
}

.blueprint-insight-cards .insight-dock-card span {
  font-size: 10.5px;
}

.network-insight-strip {
  grid-column: 1 / -1;
  min-height: 42px;
  padding: 5px 6px;
  border: 1px solid rgba(31, 128, 117, 0.22);
  border-radius: 6px;
  background: rgba(240, 250, 247, 0.78);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.network-insight-strip > strong {
  color: var(--accent-strong);
  font-size: 12px;
  white-space: nowrap;
}

.network-insight-chip {
  min-width: 0;
  max-width: 210px;
  height: 28px;
  border: 1px solid rgba(31, 128, 117, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
}

.network-insight-chip.warn {
  border-color: rgba(191, 122, 38, 0.46);
  background: rgba(255, 247, 232, 0.82);
}

.network-insight-chip:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 128, 117, 0.11);
}

.network-insight-chip .item-chip,
.network-insight-chip .icon-label,
.network-insight-chip .image-label {
  max-width: 76px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.network-insight-chip .image-label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.network-insight-chip .image-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.network-insight-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.network-insight-popover {
  position: fixed;
  z-index: 80;
  padding: 10px;
  border: 1px solid rgba(31, 128, 117, 0.32);
  border-radius: 8px;
  background: rgba(250, 254, 253, 0.96);
  box-shadow: 0 18px 44px rgba(20, 41, 48, 0.18);
  color: var(--text);
  font-size: 12px;
}

.network-insight-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.network-insight-popover-head strong {
  color: var(--accent-strong);
  font-size: 14px;
}

.network-insight-popover-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(235, 248, 245, 0.75);
}

.network-insight-popover-main .image-label {
  font-size: 14px;
  font-weight: 700;
}

.network-insight-popover-main img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.network-insight-popover p {
  margin: 8px 0;
  line-height: 1.55;
  color: #43565d;
}

.network-insight-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 10px;
  padding: 7px 8px;
  border: 1px dashed rgba(31, 128, 117, 0.24);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62);
}

.network-insight-meta span {
  color: var(--muted);
}

.network-insight-popover-actions {
  margin-top: 9px;
  display: flex;
  justify-content: flex-end;
}

.blueprint {
  position: relative;
  min-height: 280px;
  overflow: auto;
  background:
    linear-gradient(#edf2f3 1px, transparent 1px),
    linear-gradient(90deg, #edf2f3 1px, transparent 1px),
    #fbfcfc;
  background-size: 24px 24px;
}


.blueprint-empty {
  padding: 18px;
  color: var(--muted);
}

.blueprint svg {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.blueprint-group-frame {
  fill: rgba(125, 106, 176, 0.045);
  stroke: rgba(125, 106, 176, 0.55);
  stroke-width: 1.5;
  stroke-dasharray: 8 6;
}

.blueprint-group.active .blueprint-group-frame {
  fill: rgba(235, 248, 245, 0.5);
  stroke: var(--accent);
  stroke-dasharray: none;
}

.blueprint-group-hitbox {
  fill: rgba(255, 255, 255, 0.001);
  stroke: transparent;
  cursor: pointer;
  pointer-events: fill;
}

.blueprint-group text {
  fill: #6b5d91;
  font-size: 10px;
  font-weight: 600;
  paint-order: stroke;
  stroke: #fbfcfc;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.blueprint-group-label {
  cursor: pointer;
  pointer-events: all;
}

.blueprint-group-label:hover {
  fill: var(--accent-strong);
  text-decoration: underline;
}

.blueprint-group.active .blueprint-group-label {
  fill: var(--accent-strong);
}

.lcr-toggle-button.active {
  border-color: var(--accent);
  background: #eaf8f5;
  color: var(--accent-strong);
}

.blueprint-legend {
  position: sticky;
  left: 8px;
  top: 8px;
  z-index: 2;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 16px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  padding: 5px 7px;
  color: var(--muted);
  font-size: 11px;
  backdrop-filter: blur(3px);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-line {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #607d8b;
}

.legend-line.mineral {
  background: #8a6f47;
}

.legend-line.powder {
  background: #c2872d;
}

.legend-line.component {
  background: #2f6fba;
}

.legend-line.fluid {
  background: #188d8f;
}

.legend-line.organic {
  background: #6a8f2a;
}

.legend-line.waste {
  background: #7d6ab0;
}

.flow-line {
  fill: none;
  stroke: #607d8b;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.78));
}

.flow-hit-area {
  fill: none;
  stroke: transparent;
  stroke-width: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: stroke;
}

.flow-line.mineral {
  stroke: #8a6f47;
  stroke-width: 4;
}

.flow-line.powder {
  stroke: #c2872d;
  stroke-width: 4;
}

.flow-line.component {
  stroke: #2f6fba;
  stroke-width: 4;
}

.flow-line.fluid {
  stroke: #188d8f;
  stroke-width: 4.4;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.86)) drop-shadow(0 0 2px rgba(24, 141, 143, 0.18));
}

.flow-line.organic {
  stroke: #6a8f2a;
  stroke-width: 4;
}

.flow-line.waste {
  stroke: #7d6ab0;
  stroke-width: 4.2;
  stroke-dasharray: 7 5;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.84)) drop-shadow(0 0 2px rgba(125, 106, 176, 0.18));
}

.flow-line.shortcut {
  stroke-width: 3.2;
  stroke-dasharray: 3 4;
}

.flow-line.mineral,
.flow-line.powder,
.flow-line.component,
.flow-line.organic {
  stroke-linecap: butt;
}

.blueprint-edge:not(.blueprint-edge-jump) .flow-line.mineral,
.blueprint-edge:not(.blueprint-edge-jump) .flow-line.powder,
.blueprint-edge:not(.blueprint-edge-jump) .flow-line.component,
.blueprint-edge:not(.blueprint-edge-jump) .flow-line.organic {
  stroke-dasharray: 18 3;
}

.blueprint-edge.flow-provisional .flow-line {
  stroke: #c98522;
  stroke-width: 4.2;
  stroke-dasharray: 8 4;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.86)) drop-shadow(0 0 3px rgba(201, 133, 34, 0.22));
}

.blueprint-edge.flow-reused .flow-line.reference,
.blueprint-edge.flow-reused .flow-line.shortcut {
  stroke: #7d6ab0;
  stroke-width: 3.8;
  stroke-dasharray: 7 3 2 3;
}

.blueprint-edge.flow-disposal .flow-line,
.blueprint-edge.flow-manual-discard .flow-line {
  stroke: #7d6ab0;
  stroke-width: 4;
  stroke-dasharray: 6 5;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.86)) drop-shadow(0 0 3px rgba(125, 106, 176, 0.2));
}

.blueprint-edge.flow-manual-discard .flow-line {
  stroke: #586f7c;
  stroke-dasharray: 8 3 2 3;
}

.flow-label {
  fill: #455a64;
  font-size: 11px;
  paint-order: normal;
  stroke: none;
}

.flow-label-bg {
  fill: rgba(252, 254, 254, 0.9);
  stroke: rgba(143, 167, 174, 0.45);
  stroke-width: 1px;
}

.blueprint-edge,
.blueprint-edge .flow-label,
.blueprint-edge .flow-label-bg,
.blueprint-edge .flow-hit-area,
.blueprint-edge .flow-line,
.blueprint-edge-jump,
.blueprint-node .node-main[data-blueprint-jump-node] {
  cursor: pointer;
}

.blueprint-edge {
  pointer-events: auto;
}

.blueprint-edge .flow-line {
  pointer-events: stroke;
}

.blueprint-edge .flow-hit-area {
  pointer-events: stroke;
}

.blueprint-edge-input-ingress {
  pointer-events: none;
}

.blueprint-edge-input-ingress[data-blueprint-assumed-ingress-node],
.blueprint-edge-input-ingress[data-blueprint-reference-ingress-node] {
  pointer-events: auto;
  cursor: pointer;
}

.blueprint-edge-input-ingress[data-blueprint-assumed-ingress-node] .flow-hit-area,
.blueprint-edge-input-ingress[data-blueprint-reference-ingress-node] .flow-hit-area,
.blueprint-edge-input-ingress[data-blueprint-assumed-ingress-node] .flow-line,
.blueprint-edge-input-ingress[data-blueprint-reference-ingress-node] .flow-line {
  pointer-events: stroke;
}

.flow-line.input-ingress {
  stroke-width: 4;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.86));
}

.blueprint-edge-jump {
  pointer-events: auto;
}

.blueprint-edge-jump .flow-line {
  pointer-events: stroke;
}

.blueprint-edge .flow-label {
  pointer-events: bounding-box;
}

.blueprint-edge .flow-label-bg {
  pointer-events: all;
}

.blueprint-edge-jump .flow-label {
  text-decoration: underline;
  text-decoration-style: dotted;
}

.blueprint-edge-jump .flow-label-bg {
  fill: rgba(248, 244, 255, 0.82);
  stroke: rgba(125, 106, 176, 0.34);
}

.blueprint-edge-jump .flow-label {
  fill: #6f5ca2;
}

.blueprint-edge-reuse-selectable .flow-line.reference {
  stroke-dasharray: 7 3 2 3;
  stroke-width: 3.2;
}

.blueprint-edge-reuse-selectable .flow-label-bg {
  fill: rgba(255, 250, 238, 0.96);
  stroke: rgba(198, 126, 24, 0.52);
  stroke-width: 1.2px;
}

.blueprint-edge-reuse-selectable .flow-label {
  fill: #8a5a12;
  font-weight: 700;
  text-decoration: none;
}

.blueprint-edge-reuse-selectable:hover .flow-label-bg {
  fill: rgba(255, 244, 221, 0.98);
  stroke: rgba(198, 126, 24, 0.78);
}

.blueprint-edge-reuse-selectable:hover .flow-label {
  fill: #6f4300;
}

.blueprint-edge-jump:hover .flow-line {
  stroke-width: 3.5;
}

.blueprint-edge.focus-pulse .flow-line {
  animation: blueprint-edge-focus-pulse 0.55s ease-out 2;
}

.blueprint-edge.focus-pulse .flow-label {
  animation: blueprint-label-focus-pulse 0.55s ease-out 2;
}

.blueprint-edge .flow-label:hover,
.blueprint-edge .flow-label-bg:hover + .flow-label,
.blueprint-edge-jump:hover .flow-label,
.blueprint-node .node-main[data-blueprint-jump-node]:hover {
  color: var(--accent-strong);
  fill: var(--accent-strong);
}

.blueprint.reuse-pick-mode .blueprint-node {
  opacity: 0.38;
}

.blueprint.reuse-pick-mode .blueprint-edge {
  opacity: 0.28;
}

.blueprint.reuse-pick-mode .blueprint-node.reuse-pick-candidate,
.blueprint.reuse-pick-mode .blueprint-node.reuse-pick-source,
.blueprint.reuse-pick-mode .blueprint-node.focused {
  opacity: 1;
}

.blueprint.reuse-pick-mode .blueprint-edge.focus-pulse {
  opacity: 1;
}

.blueprint-node.reuse-pick-candidate {
  cursor: crosshair;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 128, 112, 0.16), 0 10px 22px rgba(22, 60, 64, 0.14);
}

.blueprint-node.reuse-pick-source {
  box-shadow: 0 0 0 2px rgba(125, 106, 176, 0.18), 0 8px 18px rgba(22, 60, 64, 0.12);
}

.blueprint-reuse-picker {
  position: fixed;
  z-index: 90;
  width: min(760px, calc(100vw - 32px));
  min-width: min(620px, calc(100vw - 32px));
  min-height: 180px;
  padding: 10px;
  border: 1px solid rgba(0, 128, 112, 0.32);
  border-radius: 8px;
  background: rgba(252, 254, 254, 0.96);
  box-sizing: border-box;
  box-shadow: 0 14px 30px rgba(32, 53, 58, 0.18);
}

.blueprint-reuse-picker-head,
.blueprint-reuse-picker-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.blueprint-reuse-picker-head {
  margin: -4px -4px 0;
  padding: 4px;
  border-radius: 6px;
  cursor: move;
  user-select: none;
}

.blueprint-reuse-picker-head:hover,
.blueprint-reuse-picker.dragging .blueprint-reuse-picker-head {
  background: rgba(0, 128, 112, 0.06);
}

.blueprint-reuse-picker-head strong {
  color: var(--accent-strong);
}

.blueprint-reuse-picker-target {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 128, 112, 0.08);
}

.blueprint-reuse-picker p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.blueprint-reuse-picker-actions {
  display: grid;
  gap: 6px;
}

.blueprint-reuse-flow-slice .byproduct-route-flow {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.blueprint-reuse-flow-slice .byproduct-route-flow-head span {
  display: none;
}

.blueprint-reuse-flow-slice .byproduct-route-flow-grid {
  grid-template-columns: 1fr;
  gap: 6px;
}

.blueprint-reuse-flow-slice .byproduct-route-option-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) repeat(4, 92px);
  gap: 6px;
  align-items: center;
}

.blueprint-reuse-flow-slice .byproduct-route-option-head {
  display: grid;
  align-items: end;
  padding: 0 8px 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.blueprint-reuse-flow-slice .byproduct-route-option {
  min-height: 48px;
  gap: 8px;
}

.blueprint-reuse-flow-slice .byproduct-route-option .blueprint-reuse-preview,
.blueprint-reuse-flow-slice .byproduct-route-option .blueprint-reuse-preview-grid {
  display: contents;
}

.blueprint-reuse-flow-slice .byproduct-route-option .byproduct-trade-equivalent {
  grid-column: 1 / 2;
  grid-row: 2;
  align-self: start;
}

.blueprint-reuse-flow-slice .byproduct-route-option .byproduct-route-overflow {
  grid-column: 2 / -1;
  grid-row: 2;
  align-self: start;
}

.blueprint-reuse-flow-slice .byproduct-route-option > small,
.blueprint-reuse-flow-slice .byproduct-route-option > b {
  display: none;
}

.blueprint-reuse-picker-actions button {
  justify-content: space-between;
  min-height: 34px;
  text-align: left;
}

.blueprint-reuse-choice-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.blueprint-reuse-choice-hint {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 128, 112, 0.08);
  color: var(--accent-strong);
  font-size: 11px;
  white-space: nowrap;
}

.blueprint-reuse-picker-actions button.selected {
  border-color: var(--accent);
  background: rgba(0, 128, 112, 0.1);
  color: var(--accent-strong);
}

.blueprint-reuse-preview {
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed rgba(0, 128, 112, 0.28);
  border-radius: 6px;
  background: rgba(240, 250, 248, 0.86);
}

.blueprint-reuse-preview-title {
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.blueprint-reuse-preview-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
  font-size: 12px;
}

.blueprint-reuse-preview-grid strong.good,
.blueprint-reuse-preview-hints span {
  color: var(--accent-strong);
}

.blueprint-reuse-preview-grid strong.warn {
  color: var(--danger);
}

.blueprint-reuse-preview-grid strong {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  justify-content: flex-end;
  white-space: nowrap;
}

.blueprint-reuse-preview-grid strong small {
  font-size: 10px;
  font-weight: 700;
}

.blueprint-reuse-preview-grid strong small.good {
  color: var(--accent-strong);
}

.blueprint-reuse-preview-grid strong small.warn {
  color: var(--danger);
}

.blueprint-reuse-preview-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.blueprint-reuse-preview-metric > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blueprint-reuse-preview-grid .blueprint-reuse-preview-metric > strong {
  justify-content: flex-start;
}

.blueprint-reuse-flow-slice .blueprint-reuse-preview-grid,
.byproduct-route-option .blueprint-reuse-preview-grid {
  grid-template-columns: repeat(4, minmax(70px, max-content));
  gap: 4px 12px;
  align-items: start;
}

.blueprint-reuse-flow-slice .blueprint-reuse-preview {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.blueprint-reuse-flow-slice .blueprint-reuse-preview-metric {
  justify-self: start;
}

.blueprint-reuse-flow-slice .blueprint-reuse-preview-metric > small {
  display: none;
}

.blueprint-reuse-preview-overflow {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed rgba(0, 128, 112, 0.22);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.blueprint-reuse-preview-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.blueprint-reuse-preview-hints span {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 128, 112, 0.08);
  font-size: 11px;
  font-weight: 700;
}

.blueprint-reuse-resize-handle {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
}

.blueprint-reuse-resize-handle::before {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(0, 128, 112, 0.45);
  border-bottom: 2px solid rgba(0, 128, 112, 0.45);
  border-radius: 1px;
}

.blueprint-reuse-picker.resizing {
  user-select: none;
}

.shortcut-label {
  font-size: 10px;
}

.reference-label {
  fill: #7a669f;
  font-size: 9px;
  font-weight: 600;
}

.flow-label-bg.reference-label {
  fill: rgba(250, 247, 255, 0.74);
  stroke: rgba(125, 106, 176, 0.28);
  stroke-dasharray: 2 2;
}

.blueprint-label-hover-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.blueprint-hover-label {
  position: absolute;
  max-width: 260px;
  padding: 2px 7px;
  border: 1px solid rgba(31, 122, 107, 0.34);
  border-radius: 4px;
  background: rgba(252, 254, 254, 0.98);
  box-shadow: 0 5px 14px rgba(29, 45, 53, 0.18);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transform: translate(-2px, -50%);
}

.blueprint-hover-label.reference {
  border-color: rgba(125, 106, 176, 0.36);
  background: rgba(250, 247, 255, 0.98);
  color: #6f5ca2;
}

.blueprint-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  border: 1px solid rgba(142, 168, 174, 0.86);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(226, 236, 236, 0.9) 0, rgba(243, 248, 247, 0.95) 20px, rgba(235, 242, 241, 0.95) 100%),
    linear-gradient(135deg, rgba(24, 64, 74, 0.09), rgba(255, 255, 255, 0) 58%),
    #edf4f3;
  padding: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(44, 70, 76, 0.05),
    0 8px 18px rgba(23, 60, 72, 0.1);
  cursor: pointer;
  overflow: hidden;
}

.blueprint-node.raw {
  background:
    linear-gradient(180deg, rgba(239, 230, 216, 0.92) 0, rgba(251, 246, 238, 0.95) 20px, rgba(246, 238, 226, 0.95) 100%),
    linear-gradient(135deg, rgba(138, 111, 71, 0.14), rgba(255, 255, 255, 0) 58%),
    #f6eddf;
}

.blueprint-node.external-supply {
  border-color: #148078;
  background:
    linear-gradient(180deg, rgba(213, 235, 230, 0.92) 0, rgba(236, 248, 244, 0.95) 20px, rgba(224, 243, 238, 0.95) 100%),
    linear-gradient(135deg, rgba(20, 128, 120, 0.14), rgba(255, 255, 255, 0) 58%),
    #e4f4f0;
}

.blueprint-node.integrated-internal {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.82);
  opacity: 0.82;
}

.blueprint-node.target {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(210, 234, 228, 0.92) 0, rgba(236, 248, 244, 0.95) 20px, rgba(224, 243, 237, 0.95) 100%),
    linear-gradient(135deg, rgba(0, 128, 112, 0.15), rgba(255, 255, 255, 0) 58%),
    #e2f3ee;
}

.blueprint-node.focused {
  border-color: #d68b00;
  box-shadow: 0 0 0 3px rgba(214, 139, 0, 0.2), 0 10px 28px rgba(20, 41, 48, 0.16);
}

.blueprint-node.focus-pulse {
  animation: blueprint-focus-pulse 0.55s ease-out 2;
}

.blueprint.reference-focus-mode .blueprint-node:not(.reference-focus-active),
.blueprint.reference-focus-mode .blueprint-edge:not(.reference-focus-active),
.blueprint.reference-focus-mode .blueprint-edge-input-ingress:not(.reference-focus-active) {
  opacity: 0.18;
  filter: grayscale(0.22);
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.blueprint.reference-focus-mode .blueprint-node.reference-focus-active {
  z-index: 4;
  opacity: 1;
  box-shadow:
    0 0 0 3px rgba(31, 122, 107, 0.2),
    0 0 18px rgba(31, 122, 107, 0.22),
    0 10px 28px rgba(20, 41, 48, 0.18);
}

.blueprint.reference-focus-mode .blueprint-edge.reference-focus-active .flow-line,
.blueprint.reference-focus-mode .blueprint-edge-input-ingress.reference-focus-active .flow-line {
  opacity: 1;
  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.94))
    drop-shadow(0 0 7px rgba(31, 122, 107, 0.28));
}

.blueprint-reference-focus-line {
  pointer-events: none;
}

.blueprint-reference-focus-halo {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 10;
  stroke-linecap: round;
}

.blueprint-reference-focus-path {
  fill: none;
  stroke: rgba(12, 119, 105, 0.92);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-dasharray: 10 5;
  filter:
    drop-shadow(0 0 4px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 8px rgba(31, 122, 107, 0.32));
  animation: blueprint-reference-focus-draw 0.42s ease-out 1;
}

.blueprint-reference-focus-chip {
  position: absolute;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  padding: 5px 6px 5px 10px;
  border: 1px solid rgba(31, 122, 107, 0.34);
  border-radius: 999px;
  background: rgba(245, 252, 250, 0.94);
  color: var(--accent-strong);
  box-shadow: 0 8px 24px rgba(22, 34, 39, 0.16);
  font-size: 12px;
  font-weight: 800;
  pointer-events: auto;
  animation: blueprint-reference-chip-enter 0.2s ease-out 1;
}

.blueprint-reference-focus-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blueprint-reference-focus-chip .icon-button {
  width: 24px;
  min-height: 24px;
  padding: 0;
}

.blueprint-node.stop-impact-source {
  border-color: #b42318;
  background: #fff3f0;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16), 0 10px 28px rgba(20, 41, 48, 0.16);
}

.blueprint-node.stop-impact-affected {
  border-color: #d68b00;
  background: #fff8e8;
}

.blueprint-node.stop-impact-critical {
  border-color: #b42318;
  background: #fff0f0;
}

.blueprint-edge.stop-impact-edge .flow-line {
  stroke-width: 4;
  filter: drop-shadow(0 0 5px rgba(180, 35, 24, 0.45));
}

.blueprint-edge.stop-impact-edge .flow-label {
  fill: #8f1f15;
  font-weight: 800;
}

.blueprint-edge.stop-impact-edge .flow-label-bg {
  fill: #fff1ed;
  stroke: #e2a09a;
}

.blueprint-edge.stop-impact-limiting .flow-line {
  stroke: #b42318;
  stroke-width: 4.5;
  filter: drop-shadow(0 0 6px rgba(180, 35, 24, 0.48));
}

.blueprint-edge.stop-impact-limiting .flow-label {
  fill: #8f1f15;
  font-weight: 850;
}

.blueprint-edge.stop-impact-limiting .flow-label-bg {
  fill: #fff1ed;
  stroke: #d96a61;
}

.blueprint-edge.stop-impact-surplus .flow-line {
  stroke: #0f766e;
  stroke-width: 3.5;
  stroke-dasharray: 7 5;
  filter: drop-shadow(0 0 5px rgba(15, 118, 110, 0.32));
}

.blueprint-edge.stop-impact-surplus .flow-label {
  fill: #0f5f59;
  font-weight: 750;
}

.blueprint-edge.stop-impact-surplus .flow-label-bg {
  fill: #ecfdf7;
  stroke: #7dd3c7;
}

.blueprint-edge.stop-impact-boosted .flow-line {
  stroke: #15803d;
  stroke-width: 4.5;
  filter: drop-shadow(0 0 6px rgba(21, 128, 61, 0.38));
}

.blueprint-edge.stop-impact-boosted .flow-label {
  fill: #096331;
  font-weight: 850;
}

.blueprint-edge.stop-impact-boosted .flow-label-bg {
  fill: #ecfdf3;
  stroke: #5fc78a;
}

.blueprint-edge.stop-impact-backpressure .flow-line {
  stroke: #9a5b00;
  stroke-width: 4.5;
  stroke-dasharray: 9 4;
  filter: drop-shadow(0 0 6px rgba(154, 91, 0, 0.42));
}

.blueprint-edge.stop-impact-backpressure .flow-label {
  fill: #8a4d00;
  font-weight: 850;
}

.blueprint-edge.stop-impact-backpressure .flow-label-bg {
  fill: #fff7e8;
  stroke: #d99a35;
}

@keyframes blueprint-focus-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(214, 139, 0, 0.55), 0 10px 28px rgba(20, 41, 48, 0.16);
  }
  48% {
    transform: scale(1.035);
    box-shadow: 0 0 0 8px rgba(214, 139, 0, 0.28), 0 14px 34px rgba(20, 41, 48, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 3px rgba(214, 139, 0, 0.2), 0 10px 28px rgba(20, 41, 48, 0.16);
  }
}

@keyframes blueprint-reference-focus-draw {
  0% {
    stroke-dashoffset: 44;
    opacity: 0.2;
  }

  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes blueprint-reference-chip-enter {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blueprint-edge-focus-pulse {
  0% {
    stroke-width: 2.5;
    filter: none;
  }
  48% {
    stroke-width: 6;
    filter: drop-shadow(0 0 6px rgba(214, 139, 0, 0.65));
  }
  100% {
    stroke-width: 2.5;
    filter: none;
  }
}

@keyframes blueprint-label-focus-pulse {
  0% {
    fill: currentColor;
  }
  48% {
    fill: #d68b00;
  }
  100% {
    fill: currentColor;
  }
}

.blueprint-node.waste {
  background:
    linear-gradient(180deg, rgba(229, 224, 244, 0.92) 0, rgba(247, 245, 253, 0.95) 20px, rgba(240, 236, 251, 0.95) 100%),
    linear-gradient(135deg, rgba(125, 106, 176, 0.14), rgba(255, 255, 255, 0) 58%),
    #f0ecfb;
  border-color: #b9acd8;
}

.blueprint-node.shortcut-input {
  background:
    linear-gradient(180deg, rgba(226, 236, 236, 0.9) 0, rgba(243, 248, 247, 0.95) 20px, rgba(235, 242, 241, 0.95) 100%),
    linear-gradient(135deg, rgba(29, 71, 82, 0.09), rgba(255, 255, 255, 0) 58%),
    #edf4f3;
  border-color: rgba(142, 168, 174, 0.86);
}

.blueprint-node.missing-provider {
  border-color: #d68b00;
  background:
    linear-gradient(180deg, rgba(248, 230, 197, 0.92) 0, rgba(255, 247, 229, 0.95) 20px, rgba(251, 238, 211, 0.95) 100%),
    linear-gradient(135deg, rgba(214, 139, 0, 0.17), rgba(255, 255, 255, 0) 58%),
    #faebce;
  box-shadow: 0 2px 8px rgba(214, 139, 0, 0.14);
}

.blueprint-node.missing-provider .node-title {
  grid-template-columns: minmax(0, 1fr);
  color: #9a6500;
}

.blueprint-node.missing-provider .node-subdetail {
  color: #9a6500;
  font-size: 10px;
  font-weight: 700;
}

.blueprint-node.reuse-unassigned {
  border-color: #d68b00;
  background:
    linear-gradient(180deg, rgba(248, 232, 204, 0.92) 0, rgba(255, 249, 233, 0.95) 20px, rgba(252, 241, 219, 0.95) 100%),
    linear-gradient(135deg, rgba(214, 139, 0, 0.16), rgba(255, 255, 255, 0) 58%),
    #faefd8;
  box-shadow: 0 2px 8px rgba(214, 139, 0, 0.12);
}

.blueprint-node.reuse-unassigned .node-title {
  grid-template-columns: minmax(0, 1fr);
  color: #9a6500;
}

.blueprint-node.reuse-unassigned .node-subdetail {
  color: #9a6500;
  font-size: 10px;
  font-weight: 700;
}

.blueprint-node.assumed-external-supply {
  border-color: #d7c4a4;
  background: #fffaf1;
  box-shadow: 0 2px 8px rgba(138, 114, 78, 0.1);
  cursor: pointer;
}

.blueprint-node.assumed-external-supply .node-title,
.blueprint-node.assumed-external-supply .node-subdetail {
  color: #7a6040;
}

.blueprint-node.assumed-external-supply .node-title {
  grid-template-columns: 18px minmax(0, 1fr);
}

.blueprint-node .node-top {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  display: flex;
  min-width: 0;
  color: #48616a;
  font-size: 10px;
  pointer-events: auto;
}

.blueprint-node .node-title {
  display: inline-flex;
  align-items: center;
  max-width: 76px;
  padding: 2px 5px;
  border: 1px solid rgba(178, 199, 204, 0.72);
  border-radius: 999px;
  background: rgba(248, 251, 251, 0.88);
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blueprint-node.raw .node-top {
  color: #73572f;
}

.blueprint-node.target .node-top,
.blueprint-node.external-supply .node-top {
  color: #0f665e;
}

.blueprint-node.waste .node-top {
  color: #5d4a8a;
}

.blueprint-node.missing-provider .node-top,
.blueprint-node.reuse-unassigned .node-top,
.blueprint-node.assumed-external-supply .node-top {
  color: #8a5e19;
}

.blueprint-node .node-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
}

.blueprint-node .node-badge {
  display: inline-flex;
  align-items: center;
  max-width: 58px;
  padding: 1px 5px;
  border: 1px solid #d7b780;
  border-radius: 999px;
  background: rgba(255, 247, 225, 0.92);
  color: #7a5a22;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blueprint-node.assumed-external-supply .node-badge.assumed {
  border-color: #c99a4a;
  background: rgba(255, 241, 207, 0.96);
  color: #7b5518;
}

.node-title-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
  background: #eef3f3;
}

.node-facility-corner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 31px;
  padding: 2px 2px 1px;
  border: 1px solid rgba(178, 199, 204, 0.7);
  border-radius: 6px;
  background: rgba(248, 251, 251, 0.92);
  box-shadow: 0 1px 4px rgba(20, 41, 48, 0.08);
}

.node-facility-corner .node-title-icon {
  width: 18px;
  height: 18px;
}

.node-facility-count {
  margin-top: -1px;
  color: #31555d;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.node-unlimited-badge {
  margin-top: -1px;
  padding: 0 4px;
  border: 1px solid rgba(24, 141, 143, 0.36);
  border-radius: 999px;
  background: rgba(224, 250, 248, 0.9);
  color: #087273;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.blueprint-node .node-main {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 5px 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
}

.blueprint-node .node-main .image-label {
  position: relative;
  display: flex;
  min-height: 0;
  width: 100%;
  height: 100%;
  gap: 3px;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.blueprint-node .node-main .image-label img {
  width: min(77px, 86%);
  height: min(77px, 86%);
  margin: 0;
  border-radius: 8px;
  background: transparent;
  transform: none;
  transform-origin: top left;
}

.blueprint-node .node-main .image-label span {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  display: -webkit-box;
  max-width: calc(100% - 8px);
  padding: 1px 3px 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  color: #101820;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.94),
    1px 0 0 rgba(255, 255, 255, 0.82),
    -1px 0 0 rgba(255, 255, 255, 0.82);
}

.blueprint[data-density="compact"] .blueprint-node .node-main {
  padding: 3px 3px 2px;
}

.blueprint[data-density="compact"] .blueprint-node .node-main .image-label img {
  width: min(42px, 82%);
  height: min(42px, 82%);
  border-radius: 5px;
}

.blueprint[data-density="compact"] .blueprint-node .node-main .image-label span {
  left: 2px;
  right: 2px;
  bottom: 0;
  max-width: calc(100% - 4px);
  padding: 0 2px 1px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.64);
  font-size: 7.5px;
  line-height: 1;
}

.blueprint[data-density="compact"] .node-facility-corner {
  width: 20px;
  min-height: 22px;
  padding: 1px 0 0;
  border-radius: 5px;
}

.blueprint[data-density="compact"] .node-facility-corner .node-title-icon {
  width: 13px;
  height: 13px;
}

.blueprint[data-density="compact"] .node-facility-count {
  font-size: 6px;
}

.blueprint[data-density="compact"] .flow-label,
.blueprint[data-density="compact"] .shortcut-label {
  font-size: 8px;
}

.blueprint[data-density="compact"] .node-unlimited-badge {
  padding: 0 3px;
  font-size: 8px;
}

.blueprint[data-density="compact"] .node-status-row {
  padding: 0 3px 3px;
}

.blueprint[data-density="compact"] .node-badge {
  max-width: 44px;
  padding: 0 3px;
  font-size: 7px;
}

.blueprint[data-density="compact"] .blueprint-node.assumed-external-supply .node-main {
  padding-top: 1px;
}

.blueprint[data-density="compact"] .blueprint-node.assumed-external-supply .node-main .image-label img {
  width: min(38px, 78%);
  height: min(38px, 78%);
}

.blueprint[data-density="compact"] .blueprint-node.assumed-external-supply .node-badges {
  left: 3px;
  right: 3px;
  bottom: 13px;
}

.blueprint[data-density="compact"] .blueprint-node.assumed-external-supply .node-badge.assumed {
  max-width: 22px;
}

.blueprint[data-density="compact"] .blueprint-node.assumed-external-supply .node-subdetail {
  display: none;
}

.blueprint[data-density="debug"] .flow-label {
  font-weight: 750;
}

.blueprint-node .node-status-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0 6px 5px;
}

.blueprint-node .node-subdetail {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-impact-panel {
  margin-top: 8px;
  border: 1px solid #d7b4a8;
  border-radius: 6px;
  background: #fffaf7;
  box-shadow: 0 6px 18px rgba(36, 24, 20, 0.08);
  overflow: hidden;
}

.stop-impact-head,
.stop-impact-summary,
.stop-impact-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #f0d8cf;
}

.stop-impact-head {
  justify-content: space-between;
  background: #fff4ee;
}

.stop-impact-head strong {
  margin-right: auto;
}

.stop-impact-head .small-button {
  padding: 4px 8px;
  border: 1px solid #d7b4a8;
  border-radius: 5px;
  background: #fff;
  color: #87513f;
  font-size: 12px;
  font-weight: 700;
}

.stop-impact-summary {
  justify-content: space-between;
  flex-wrap: wrap;
}

.stop-impact-summary > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.stop-impact-control {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(74px, auto);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #f0d8cf;
  color: #87513f;
  font-size: 12px;
  font-weight: 700;
}

.stop-impact-control input[type="range"] {
  width: 100%;
  accent-color: #b42318;
}

.stop-impact-control b {
  color: #8f1f15;
  text-align: right;
}

.stop-impact-control.compact {
  flex: 1;
  min-width: 260px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.stop-impact-scenario-list {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #f0d8cf;
}

.stop-impact-scenario-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid #ecd0c5;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.stop-impact-scenario-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 180px;
  max-width: 260px;
}

.stop-impact-scenario-item small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-impact-label {
  color: #87513f;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stop-impact-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.stop-impact-chip {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 6px;
  padding: 4px 7px;
  border: 1px solid #ecd0c5;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.stop-impact-chip.critical {
  border-color: #e5a19a;
  background: #fff1ef;
}

.stop-impact-chip.jam {
  border-color: #e4bf79;
  background: #fff8e8;
  color: #805000;
}

.stop-impact-chip .image-label {
  grid-row: span 2;
}

.stop-impact-chip b {
  color: #8f1f15;
}

.stop-impact-chip small {
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-impact-note,
.stop-impact-warning {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.stop-impact-warning {
  color: #8f1f15;
  font-weight: 700;
}

.blueprint-solution {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  background: #fbfcfc;
  overflow: auto;
}

.blueprint-solution-heading {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.solver-canvas {
  position: relative;
  min-width: 100%;
  min-height: 240px;
  background:
    linear-gradient(#edf2f3 1px, transparent 1px),
    linear-gradient(90deg, #edf2f3 1px, transparent 1px),
    #fbfcfc;
  background-size: 34px 34px;
}

.solver-warning-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.solver-canvas svg {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.solver-node {
  position: absolute;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 2px;
  min-width: 0;
  border: 1px solid #b9cbd0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  padding: 5px;
  box-shadow: 0 2px 8px rgba(23, 32, 36, 0.08);
  cursor: pointer;
}

.solver-node.raw {
  background: #fffaf4;
}

.solver-node.target {
  border-color: var(--accent);
  background: #f3fbf8;
}

.solver-node.focused {
  border-color: #d68b00;
  box-shadow: 0 0 0 3px rgba(214, 139, 0, 0.2), 0 10px 28px rgba(20, 41, 48, 0.16);
}

.solver-node.focus-pulse {
  animation: blueprint-focus-pulse 0.55s ease-out 2;
}

.solver-node.shortcut-input {
  border-color: #a9c6df;
  background: #f7fbff;
}

.solver-node-title {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  color: #415158;
  font-size: 10px;
  font-weight: 700;
}

.solver-node-title.no-icon {
  grid-template-columns: minmax(0, 1fr);
}

.solver-node-title img,
.solver-node-item .image-label img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
  background: #eef3f3;
}

.solver-node-title span,
.solver-node-item .image-label span,
.solver-node-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.solver-node-item {
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: 10px;
}

.solver-node-item .image-label {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px;
  min-height: 20px;
  min-width: 0;
}

.solver-node-meta {
  color: var(--muted);
  font-size: 8px;
}

.solver-route-cell {
  fill: #607d8b;
  opacity: 0.78;
  cursor: pointer;
  pointer-events: all;
}

.solver-route-arrow {
  fill: #607d8b;
  opacity: 0.95;
  cursor: pointer;
  pointer-events: all;
}

.solver-route-cell.mineral,
.solver-route-arrow.mineral {
  fill: #8a6f47;
}

.solver-route-cell.powder,
.solver-route-arrow.powder {
  fill: #c2872d;
}

.solver-route-cell.component,
.solver-route-arrow.component {
  fill: #2f6fba;
}

.solver-route-cell.fluid,
.solver-route-arrow.fluid {
  fill: #188d8f;
}

.solver-route-cell.organic,
.solver-route-arrow.organic {
  fill: #6a8f2a;
}

.solver-route-cell.waste,
.solver-route-arrow.waste {
  fill: #7d6ab0;
}

.solver-route-cell.default,
.solver-route-arrow.default {
  fill: #607d8b;
}

.solver-flow-label {
  fill: #455a64;
  font-size: 10px;
  paint-order: stroke;
  stroke: #fbfcfc;
  stroke-width: 5px;
  stroke-linejoin: round;
  cursor: pointer;
  pointer-events: all;
}

.solver-edge.focus-pulse .solver-route-cell,
.solver-edge.focus-pulse .solver-route-arrow {
  animation: solver-route-focus-pulse 0.55s ease-out 2;
}

.solver-edge.focus-pulse .solver-flow-label {
  animation: blueprint-label-focus-pulse 0.55s ease-out 2;
}

@keyframes solver-route-focus-pulse {
  0% {
    filter: none;
  }
  48% {
    filter: drop-shadow(0 0 7px rgba(214, 139, 0, 0.78));
  }
  100% {
    filter: none;
  }
}

.reference-search {
  width: min(360px, 100%);
}

.reference-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
  padding: 14px;
}

.reference-basics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  padding: 12px 14px 0;
}

.reference-basic-card {
  min-width: 0;
  border: 1px solid rgba(183, 205, 211, 0.86);
  border-radius: 8px;
  background: rgba(248, 252, 252, 0.92);
  overflow: hidden;
}

.reference-basic-card-head {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(211, 225, 228, 0.9);
  background: rgba(238, 248, 245, 0.62);
}

.reference-basic-card-head strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.reference-basic-card-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.reference-mini-table {
  display: grid;
  gap: 1px;
  padding: 6px;
  font-size: 11px;
}

.reference-mini-row {
  display: grid;
  grid-template-columns: var(--reference-mini-columns, repeat(4, minmax(0, 1fr)));
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
}

.reference-mini-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-mini-head {
  color: var(--muted);
  font-weight: 800;
  background: transparent;
}

.reference-status {
  display: inline-flex;
  width: max-content;
  padding: 1px 6px;
  border: 1px solid rgba(173, 188, 196, 0.85);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.reference-status.yes {
  border-color: rgba(31, 122, 107, 0.34);
  background: rgba(231, 246, 242, 0.86);
  color: var(--accent-strong);
}

.reference-card {
  min-width: 0;
  border: 1px solid rgba(183, 205, 211, 0.86);
  border-radius: 8px;
  background: rgba(248, 252, 252, 0.92);
  overflow: hidden;
}

.reference-card h3 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(211, 225, 228, 0.9);
  background: rgba(238, 248, 245, 0.62);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.reference-table {
  max-height: 72vh;
  overflow: auto;
  border: 0;
  border-radius: 0;
}

.reference-recipe-panel {
  padding: 14px;
}

.reference-transfer-panel {
  padding: 14px;
}

.reference-transfer-panel[hidden] {
  display: none;
}

.reference-transfer-panel .reference-basic-card {
  max-width: 980px;
}

.reference-transfer-panel .reference-mini-table {
  max-height: 58vh;
  overflow: auto;
}

.reference-recipe-layout {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
}

.reference-recipe-card {
  max-width: max-content;
}

.reference-recipe-card h3 {
  min-width: 620px;
}

.reference-recipe-wrap {
  max-height: 76vh;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.reference-recipe-side {
  min-width: 0;
}

.reference-recipe-side:empty {
  display: none;
}

.reference-chip-cell {
  max-width: 320px;
}

.reference-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 62px;
  overflow: hidden;
}

.reference-chip {
  display: inline-grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 4px;
  max-width: 150px;
  border: 1px solid #d7e2e5;
  border-radius: 6px;
  background: #f7fafa;
  padding: 2px 5px 2px 3px;
  font-size: 11px;
}

.reference-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
  background: #eef3f3;
}

.reference-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-chip-more {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
}

.reference-inline-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
}

.reference-inline-chips .reference-chip {
  max-width: 120px;
}

.reference-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.reference-meta-tags span {
  padding: 1px 5px;
  border: 1px solid rgba(0, 112, 92, 0.16);
  border-radius: 999px;
  background: rgba(238, 248, 245, 0.78);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.reference-port-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
}

.reference-port-list span {
  padding: 1px 5px;
  border: 1px solid rgba(173, 188, 196, 0.8);
  border-radius: 999px;
  background: rgba(246, 250, 250, 0.9);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
