/* Fluid/byproduct audit summary styles. Split from styles.css. */

.byproduct-audit-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 10px;
  padding: 12px;
}

.empty-note {
  margin: 0;
  color: var(--muted);
}

.byproduct-audit-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
  box-shadow: 0 2px 10px rgba(23, 32, 36, 0.06);
}

.byproduct-audit-card.fluid {
  box-shadow: inset 3px 0 0 #188d8f, 0 2px 10px rgba(23, 32, 36, 0.06);
}

.byproduct-audit-card.waste {
  box-shadow: inset 3px 0 0 #7d6ab0, 0 2px 10px rgba(23, 32, 36, 0.06);
}

.byproduct-audit-card.focused {
  outline: 2px solid rgba(214, 139, 0, 0.45);
  outline-offset: -2px;
  background: rgba(255, 244, 220, 0.55);
}

.byproduct-audit-card.focus-pulse {
  animation: water-row-focus-pulse 0.55s ease-out 2;
}

.byproduct-selected-flow-detail {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(31, 122, 107, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(239, 249, 247, 0.72), rgba(255, 255, 255, 0.9));
}

.byproduct-selected-flow-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.byproduct-selected-flow-head strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.byproduct-selected-flow-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-selected-flow-card {
  gap: 8px;
  border-color: rgba(31, 122, 107, 0.2);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.surplus-absorber-panel {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid rgba(191, 122, 38, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 249, 237, 0.82), rgba(255, 255, 255, 0.9));
}

.surplus-absorber-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.surplus-absorber-head strong {
  color: #795000;
  font-size: 13px;
}

.surplus-absorber-head > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-strong);
  font-weight: 800;
}

.surplus-absorber-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.surplus-absorber-list {
  display: grid;
  gap: 7px;
}

.surplus-absorber-candidate {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(31, 122, 107, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.surplus-absorber-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-weight: 750;
}

.surplus-absorber-context {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.surplus-absorber-context small {
  color: #795000;
  font-weight: 800;
}

.surplus-absorber-context > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 160px;
  padding: 2px 6px;
  border: 1px solid rgba(191, 122, 38, 0.18);
  border-radius: 999px;
  background: rgba(255, 249, 237, 0.7);
}

.surplus-absorber-context .image-label span {
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surplus-absorber-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(120px, 0.8fr) minmax(150px, 1.2fr);
  gap: 6px;
}

.surplus-absorber-grid > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(31, 122, 107, 0.1);
  border-radius: 6px;
  background: rgba(246, 252, 251, 0.72);
}

.surplus-absorber-grid small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
}

.surplus-absorber-material {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.surplus-absorber-material .image-label span,
.surplus-absorber-route .image-label span {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surplus-absorber-material b {
  color: var(--accent-strong);
  white-space: nowrap;
}

.surplus-absorber-flag {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(235, 248, 245, 0.9);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.byproduct-selected-flow-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(31, 122, 107, 0.14);
  border-radius: 7px;
  background: rgba(239, 249, 247, 0.58);
}

.byproduct-selected-flow-path {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  align-items: center;
  min-width: 0;
}

.byproduct-selected-flow-path .image-label span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-selected-flow-rate {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.byproduct-audit-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) max-content minmax(0, 1.3fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.byproduct-audit-compact-summary {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(110px, 0.8fr) minmax(190px, 1.2fr) repeat(4, minmax(78px, 0.5fr));
  gap: 8px 10px;
  align-items: center;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(31, 122, 107, 0.14);
  border-radius: 7px;
  background: rgba(248, 252, 251, 0.82);
}

.byproduct-audit-compact-summary > span {
  min-width: 0;
}

.byproduct-audit-flow {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-audit-compact-summary > span:not(.byproduct-audit-title):not(.byproduct-audit-flow):not(.byproduct-audit-source) {
  display: grid;
  gap: 2px;
}

.byproduct-audit-compact-summary small,
.byproduct-audit-source.compact small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.byproduct-audit-compact-summary b {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.byproduct-audit-compact-summary .warn b {
  color: var(--warn);
}

.byproduct-audit-compact-summary .ok b {
  color: var(--accent-strong);
}

.byproduct-audit-title,
.byproduct-audit-source {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.byproduct-audit-title .image-label span,
.byproduct-audit-source .image-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-audit-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.byproduct-audit-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfb;
  padding: 6px 8px;
}

.byproduct-audit-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.byproduct-audit-metrics b {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-audit-metrics .warn b {
  color: var(--warn);
}

.byproduct-audit-metrics .ok b {
  color: var(--accent-strong);
}

.byproduct-audit-metrics .image-label {
  min-width: 0;
}

.byproduct-audit-metrics .image-label img {
  width: 22px;
  height: 22px;
}

.byproduct-reuse-candidates {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px dashed rgba(0, 112, 92, 0.28);
  border-radius: 7px;
  background: rgba(0, 112, 92, 0.04);
}

.byproduct-reuse-candidates > strong {
  color: var(--accent-strong);
  font-size: 12px;
}

.byproduct-reuse-candidates > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.byproduct-reuse-candidate-list {
  display: grid;
  gap: 5px;
}

.byproduct-reuse-candidate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
}

.byproduct-reuse-candidate.active {
  border-color: rgba(0, 112, 92, 0.35);
  background: rgba(0, 112, 92, 0.08);
}

.byproduct-reuse-candidate-main {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: center;
  min-width: 0;
}

.byproduct-reuse-candidate-main .image-label span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-reuse-candidate button {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}

.byproduct-generation-trace {
  margin-top: 6px;
}

.byproduct-generation-formula {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: center;
  margin: 6px 0;
  padding: 7px 8px;
  border: 1px solid rgba(31, 122, 107, 0.18);
  border-radius: 7px;
  background: rgba(255, 250, 238, 0.72);
  font-size: 12px;
}

.byproduct-generation-formula > span:first-child {
  color: var(--accent-strong);
  font-weight: 700;
}

.byproduct-generation-formula .image-label img {
  width: 22px;
  height: 22px;
}

.byproduct-generation-formula b {
  color: var(--accent-strong);
  font-size: 14px;
}

.byproduct-route-flow {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(0, 112, 92, 0.22);
  border-radius: 7px;
  background: rgba(248, 252, 251, 0.92);
}

.byproduct-route-flow-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.byproduct-route-flow-head strong {
  color: var(--accent-strong);
  font-size: 12px;
}

.byproduct-route-flow-head span {
  color: var(--muted);
  font-size: 11px;
}

.byproduct-current-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 8px;
  border: 1px solid rgba(31, 122, 107, 0.18);
  border-radius: 7px;
  background: rgba(239, 249, 247, 0.68);
}

.byproduct-current-flow-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.byproduct-current-flow-path {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.byproduct-current-flow-path .item-chip {
  max-width: 150px;
}

.byproduct-current-flow-arrow {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
}

.byproduct-route-flow-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.byproduct-route-option {
  position: relative;
  display: grid;
  gap: 5px;
  align-content: start;
  min-height: 64px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  text-align: left;
}

.byproduct-route-option-table {
  display: grid;
  gap: 6px;
}

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

.byproduct-route-option-table .byproduct-route-option-head {
  display: grid;
  padding: 0 8px 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.byproduct-route-option-table .byproduct-route-option {
  min-height: 44px;
  gap: 8px;
  align-content: center;
}

.byproduct-route-option-table .byproduct-route-option > small,
.byproduct-route-option-table .byproduct-route-option > b {
  display: none;
}

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

.byproduct-route-option-table .blueprint-reuse-preview {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.byproduct-route-option-table .blueprint-reuse-preview-metric {
  justify-self: start;
  width: 100%;
}

.byproduct-route-option-table .blueprint-reuse-preview-metric > small {
  display: none;
}

.byproduct-route-option-table .blueprint-reuse-preview-metric > strong {
  justify-content: flex-start;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.byproduct-route-option-table .byproduct-route-overflow {
  grid-column: 2 / -1;
  grid-row: 2;
  align-self: start;
}

.byproduct-route-option:not(.disabled):hover {
  border-color: rgba(0, 112, 92, 0.38);
  background: #fffdf5;
}

.byproduct-route-option.option-hover {
  border-color: rgba(184, 47, 47, 0.58);
  background: rgba(255, 249, 241, 0.98);
  box-shadow: inset 0 0 0 1px rgba(184, 47, 47, 0.32), 0 0 0 2px rgba(184, 47, 47, 0.08);
}

.byproduct-route-option.selected {
  border-color: var(--accent);
  background: rgba(20, 132, 120, 0.09);
  box-shadow: inset 3px 0 0 var(--accent);
}

.byproduct-route-option.selected.option-hover {
  border-color: rgba(184, 47, 47, 0.58);
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px rgba(184, 47, 47, 0.34), 0 0 0 2px rgba(184, 47, 47, 0.08);
}

.byproduct-route-option .blueprint-reuse-preview {
  margin-top: 3px;
  padding: 6px;
  background: rgba(240, 250, 248, 0.72);
}

.byproduct-route-option .blueprint-reuse-preview-grid {
  grid-template-columns: minmax(90px, max-content) max-content;
  gap: 3px 10px;
}

.byproduct-route-option.disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.72;
}

.byproduct-route-option-title {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.byproduct-route-option-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 5px;
  background: #eef3f3;
}

.byproduct-route-option b {
  color: var(--accent-strong);
  font-size: 14px;
}

.byproduct-route-option small {
  color: var(--muted);
  font-size: 11px;
}

.byproduct-route-overflow {
  margin: 0;
  color: var(--warn);
  font-size: 11px;
  font-weight: 700;
}

.byproduct-audit-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.byproduct-audit-links.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.byproduct-audit-links.compact > span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.byproduct-audit-links > div {
  display: grid;
  gap: 5px;
}

.byproduct-audit-links strong {
  color: var(--muted);
  font-size: 12px;
}


.byproduct-audit-overlay {
  width: min(1280px, calc(100vw - 20px));
  height: min(620px, calc(100vh - 20px));
  max-height: min(620px, calc(100vh - 20px));
}


.byproduct-audit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 8px 0 4px;
}

.byproduct-audit-summary span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  min-width: 0;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fbfb;
}

.byproduct-audit-summary small {
  color: var(--muted);
  font-size: 11px;
}

.byproduct-audit-summary b {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-audit-summary .warn b {
  color: var(--warn);
}

.byproduct-audit-summary .ok b {
  color: var(--accent-strong);
}

.byproduct-consumer-breakdown-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--accent-strong);
  font-size: 12px;
}

.byproduct-consumer-breakdown-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.byproduct-consumer-inflow {
  display: grid;
  gap: 5px;
  margin: 6px 0 10px;
  padding: 6px 8px;
  border: 1px solid rgba(31, 122, 107, 0.18);
  border-radius: 7px;
  background: rgba(239, 249, 247, 0.56);
}

.byproduct-consumer-inflow-table {
  display: grid;
  gap: 2px;
  overflow-x: auto;
}

.byproduct-consumer-inflow-head,
.byproduct-consumer-inflow-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) repeat(5, minmax(68px, max-content)) minmax(120px, 0.8fr);
  gap: 8px;
  align-items: center;
  min-width: 760px;
  padding: 3px 5px;
}

.byproduct-consumer-inflow-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.byproduct-consumer-inflow-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.byproduct-consumer-inflow-row.shortage {
  border-color: rgba(196, 75, 51, 0.35);
  background: rgba(255, 244, 239, 0.78);
}

.byproduct-consumer-inflow-row.total {
  border-color: rgba(31, 122, 107, 0.3);
  background: rgba(232, 246, 243, 0.82);
  box-shadow: inset 3px 0 0 rgba(31, 122, 107, 0.62);
}

.byproduct-consumer-inflow-row.source {
  border-color: rgba(41, 111, 134, 0.16);
  background: rgba(247, 252, 252, 0.86);
}

.byproduct-consumer-inflow-row.clickable {
  cursor: pointer;
}

.byproduct-consumer-inflow-row.flow-hover {
  border-color: rgba(31, 122, 107, 0.52);
  background: rgba(226, 243, 240, 0.96);
  box-shadow: inset 3px 0 0 var(--accent), 0 1px 5px rgba(31, 122, 107, 0.12);
}

.byproduct-consumer-inflow-row.flow-related {
  border-color: var(--line);
}

.byproduct-consumer-inflow-row.flow-related .byproduct-flow-chip {
  outline: 1px dashed rgba(31, 122, 107, 0.34);
  outline-offset: 2px;
}

.byproduct-consumer-inflow-row.selected {
  border-color: rgba(13, 119, 101, 0.92);
  background: linear-gradient(90deg, rgba(214, 241, 236, 0.98), rgba(245, 253, 251, 0.98));
  box-shadow:
    inset 6px 0 0 var(--accent),
    0 0 0 1px rgba(13, 119, 101, 0.24),
    0 2px 8px rgba(31, 122, 107, 0.16);
}

.byproduct-consumer-inflow-row.pulse {
  animation: byproduct-flow-row-pulse 0.7s ease-out 1;
}

.byproduct-consumer-inflow-row b {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.byproduct-consumer-inflow-row b.ok {
  color: var(--accent-strong);
}

.byproduct-consumer-inflow-row b.manual {
  color: #6d5a9f;
}

.byproduct-consumer-inflow-row b.warn {
  color: var(--warn);
}

.byproduct-consumer-inflow-target {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.byproduct-consumer-inflow-total-label {
  color: var(--accent-strong);
  font-weight: 800;
}

.byproduct-consumer-inflow-target .byproduct-inline-label,
.byproduct-edge-endpoint .byproduct-inline-label {
  display: inline-grid;
  grid-template-columns: 22px auto;
  gap: 4px;
  align-items: center;
  min-width: 0;
  vertical-align: middle;
}

.byproduct-consumer-inflow-target .byproduct-inline-label img,
.byproduct-edge-endpoint .byproduct-inline-label img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  background: #eef3f3;
}

.byproduct-consumer-inflow-target .byproduct-inline-label span {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-flow-hints {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.byproduct-flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 92px;
  padding: 2px 5px;
  border: 1px solid rgba(31, 122, 107, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.byproduct-flow-chip:hover {
  border-color: rgba(31, 122, 107, 0.5);
  background: rgba(226, 243, 240, 0.92);
}

.byproduct-flow-chip.reuse {
  border-color: rgba(109, 90, 159, 0.32);
  color: #5d4a8a;
}

.byproduct-flow-chip.provisional {
  border-color: rgba(201, 154, 74, 0.38);
  color: #7b5518;
}

.byproduct-flow-chip.more {
  color: var(--muted);
}

.byproduct-flow-chip .byproduct-inline-label {
  display: inline-grid;
  grid-template-columns: 16px minmax(0, auto);
  gap: 2px;
  align-items: center;
  min-width: 0;
}

.byproduct-flow-chip .byproduct-inline-label img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
  background: #eef3f3;
}

.byproduct-flow-chip .byproduct-inline-label span {
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-mini-sankey {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  padding: 5px 6px;
  border: 1px solid rgba(31, 122, 107, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.55);
  overflow-x: auto;
}

.byproduct-mini-sankey svg {
  display: block;
  min-width: 640px;
  width: 100%;
  height: auto;
}

.byproduct-route-diff-sankey {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  padding: 6px;
  border: 1px solid rgba(31, 122, 107, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.58);
  overflow-x: auto;
}

.byproduct-route-diff-sankey svg {
  display: block;
  min-width: 680px;
  width: 100%;
  height: auto;
}

.byproduct-route-diff-lane {
  opacity: 0.72;
}

.byproduct-route-diff-lane.active {
  opacity: 1;
}

.byproduct-route-flow.option-hovering .byproduct-route-diff-lane {
  opacity: 0.22;
}

.byproduct-route-flow.option-hovering .byproduct-route-diff-lane.option-hover {
  opacity: 1;
}

.byproduct-route-diff-lane.option-hover .byproduct-route-diff-link {
  opacity: 0.98;
  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.96))
    drop-shadow(0 0 7px rgba(184, 47, 47, 0.34));
}

.byproduct-route-diff-lane.option-hover .byproduct-route-diff-node rect {
  stroke: rgba(184, 47, 47, 0.72);
  stroke-width: 1.5px;
  stroke-dasharray: 4 3;
}

.byproduct-route-diff-lane.option-hover .byproduct-route-diff-rate,
.byproduct-route-diff-lane.option-hover .byproduct-route-diff-lane-label {
  fill: #8a2c20;
}

.byproduct-route-diff-lane-label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.84);
  stroke-width: 3px;
}

.byproduct-route-diff-lane.active .byproduct-route-diff-lane-label {
  fill: var(--accent-strong);
}

.byproduct-route-diff-link {
  fill: none;
  stroke: var(--sankey-color, rgba(88, 112, 121, 0.5));
  stroke-linecap: round;
  opacity: 0.58;
}

.byproduct-route-diff-lane.active .byproduct-route-diff-link {
  opacity: 0.92;
  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 6px var(--sankey-glow, rgba(31, 122, 107, 0.24)));
}

.byproduct-route-diff-link.disposal {
  stroke-dasharray: 4 3;
}

.byproduct-route-diff-node rect {
  fill: rgba(239, 249, 247, 0.92);
  stroke: rgba(31, 122, 107, 0.22);
}

.byproduct-route-diff-node.disposal rect {
  fill: rgba(248, 251, 251, 0.92);
  stroke: rgba(113, 132, 139, 0.22);
}

.byproduct-route-diff-node text {
  fill: var(--text);
  font-size: 10px;
  font-weight: 750;
}

.byproduct-route-diff-rate {
  fill: var(--text);
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3px;
  font-size: 9px;
  font-weight: 800;
}

.byproduct-route-diff-rate.reuse {
  fill: #5d4a8a;
}

.byproduct-route-diff-rate.disposal {
  fill: #7f5d23;
}

.byproduct-sankey-link path {
  fill: none;
  stroke: var(--sankey-color, rgba(88, 112, 121, 0.5));
  stroke-linecap: round;
  opacity: 0.88;
  cursor: pointer;
}

.byproduct-sankey-link:hover path {
  opacity: 0.95;
  filter:
    drop-shadow(0 0 3px var(--sankey-glow, rgba(0, 112, 92, 0.18)))
    drop-shadow(0 1px 2px rgba(18, 48, 56, 0.12));
}

.byproduct-sankey-link.normal path {
  stroke: var(--sankey-color, rgba(54, 91, 102, 0.58));
}

.byproduct-sankey-link.reuse path {
  stroke: var(--sankey-color, rgba(93, 74, 138, 0.62));
}

.byproduct-sankey-link.provisional path {
  stroke: var(--sankey-color, rgba(180, 120, 31, 0.62));
}

.byproduct-sankey-link.selected path {
  stroke: var(--sankey-color, #007f6f);
  opacity: 1;
  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.92))
    drop-shadow(0 0 6px var(--sankey-glow, rgba(0, 112, 92, 0.58)))
    drop-shadow(0 0 12px var(--sankey-glow, rgba(0, 112, 92, 0.32)));
}

.byproduct-sankey-link.pulse path {
  animation: byproduct-sankey-path-pulse 0.7s ease-out 1;
}

.byproduct-sankey-link text {
  fill: #48616a;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 3px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.byproduct-sankey-link.selected text {
  fill: #005f54;
  font-weight: 900;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 4px;
}

.byproduct-sankey-link.pulse text {
  animation: byproduct-sankey-text-pulse 0.7s ease-out 1;
}

@keyframes byproduct-sankey-path-pulse {
  0% {
    opacity: 0.92;
    filter:
      drop-shadow(0 0 1px rgba(255, 255, 255, 0.88))
      drop-shadow(0 0 2px var(--sankey-glow, rgba(0, 112, 92, 0.24)));
  }

  42% {
    opacity: 1;
    filter:
      drop-shadow(0 0 5px rgba(255, 255, 255, 0.96))
      drop-shadow(0 0 12px var(--sankey-glow, rgba(0, 112, 92, 0.58)))
      drop-shadow(0 0 20px var(--sankey-glow, rgba(0, 112, 92, 0.38)));
  }

  100% {
    opacity: 0.96;
    filter:
      drop-shadow(0 0 3px rgba(255, 255, 255, 0.88))
      drop-shadow(0 0 6px var(--sankey-glow, rgba(0, 112, 92, 0.34)));
  }
}

@keyframes byproduct-sankey-text-pulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
  }

  42% {
    transform: scale(1.025);
    filter:
      drop-shadow(0 0 2px rgba(255, 255, 255, 0.92))
      drop-shadow(0 0 4px var(--sankey-glow, rgba(0, 112, 92, 0.26)));
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
  }
}

@keyframes byproduct-flow-row-pulse {
  0% {
    box-shadow:
      inset 4px 0 0 rgba(31, 122, 107, 0.52),
      0 0 0 0 rgba(31, 122, 107, 0.28);
  }

  45% {
    box-shadow:
      inset 6px 0 0 var(--accent),
      0 0 0 4px rgba(31, 122, 107, 0.16),
      0 0 18px rgba(31, 122, 107, 0.22);
  }

  100% {
    box-shadow:
      inset 6px 0 0 rgba(31, 122, 107, 0.58),
      0 0 0 0 rgba(31, 122, 107, 0);
  }
}

.byproduct-sankey-node rect {
  fill: rgba(239, 249, 247, 0.94);
  stroke: rgba(31, 122, 107, 0.26);
}

.byproduct-sankey-node.source rect {
  fill: rgba(236, 246, 249, 0.94);
  stroke: rgba(41, 111, 134, 0.24);
}

.byproduct-sankey-node text {
  fill: var(--text);
  font-size: 11px;
  font-weight: 750;
}

.byproduct-sankey-node .byproduct-sankey-badge-bg {
  fill: rgba(255, 244, 220, 0.96);
  stroke: rgba(201, 154, 74, 0.5);
}

.byproduct-sankey-node .byproduct-sankey-badge-text {
  fill: #7b5518;
  font-size: 8px;
  font-weight: 850;
  text-anchor: middle;
}

.byproduct-consumer-node {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.byproduct-edge-endpoint {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.byproduct-consumer-node .byproduct-inline-label {
  display: inline-grid;
  grid-template-columns: 22px auto;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.byproduct-consumer-node .byproduct-inline-label img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  background: #eef3f3;
}

.byproduct-consumer-node .byproduct-inline-label span {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-edge-endpoint .byproduct-inline-label + .byproduct-inline-label span {
  max-width: 86px;
  color: var(--muted);
  font-size: 11px;
}

.byproduct-consumer-rate {
  color: var(--accent-strong);
  font-weight: 700;
  white-space: nowrap;
}

.byproduct-consumer-routes {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.byproduct-audit-top-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfb;
}

.byproduct-audit-top-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.byproduct-audit-top-metric small,
.byproduct-audit-top-metric span,
.byproduct-audit-top-metric em {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-audit-top-metric b {
  color: var(--text);
  font-size: 14px;
}

.byproduct-audit-top-metric em {
  min-width: 0;
  font-style: normal;
}

.byproduct-audit-selector {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 251, 251, 0.86);
}

.byproduct-audit-selector .recipe-tracer-filter {
  padding-right: 8px;
  border-right: 1px solid rgba(203, 216, 221, 0.75);
}

.byproduct-audit-item-strip {
  display: flex;
  gap: 6px;
  min-height: auto;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 0 4px;
}

.byproduct-audit-item-strip .recipe-tracer-item {
  flex: 0 0 auto;
  grid-template-columns: minmax(115px, 170px) max-content;
  width: auto;
  min-width: 190px;
  padding: 5px 7px;
}

.byproduct-audit-item-strip .recipe-tracer-badges {
  flex-wrap: nowrap;
  overflow: hidden;
}

.byproduct-audit-item-strip .recipe-tracer-badges span {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-constrained-summary {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(183, 72, 53, 0.22);
  border-radius: 6px;
  background: rgba(183, 72, 53, 0.05);
}

.byproduct-constrained-summary strong {
  color: var(--muted);
  font-size: 11px;
}

.byproduct-constrained-summary > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.byproduct-constrained-summary .image-label {
  min-width: 0;
}

.byproduct-constrained-summary .image-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-constrained-summary b {
  color: var(--warn);
  font-size: 12px;
  white-space: nowrap;
}

.byproduct-trade-equivalent {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
  color: var(--accent-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.byproduct-trade-equivalent .image-label {
  min-width: 0;
}

.byproduct-trade-equivalent .image-label img {
  width: 20px;
  height: 20px;
}

.byproduct-trade-equivalent .image-label span {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byproduct-audit-route-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.byproduct-audit-route-head strong {
  color: var(--text);
  font-size: 13px;
}

.recipe-tracer-route-list {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.recipe-tracer-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.recipe-tracer-route span {
  overflow-wrap: anywhere;
  white-space: normal;
}

.recipe-tracer-route .byproduct-audit-route-label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.byproduct-audit-route-index {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eef5f4;
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1;
}

.recipe-tracer-route .byproduct-audit-route-side {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  white-space: nowrap;
}

.byproduct-audit-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.byproduct-audit-status.unused {
  border-color: rgba(183, 72, 53, 0.35);
  background: rgba(183, 72, 53, 0.08);
  color: var(--warn);
}

.byproduct-audit-status.partial {
  border-color: rgba(214, 139, 0, 0.35);
  background: rgba(214, 139, 0, 0.1);
  color: #9a6100;
}

.byproduct-audit-status.reused {
  border-color: rgba(0, 112, 92, 0.3);
  background: rgba(0, 112, 92, 0.08);
  color: var(--accent-strong);
}

.byproduct-audit-status.manual {
  border-color: rgba(88, 111, 124, 0.35);
  background: rgba(88, 111, 124, 0.08);
  color: var(--muted);
}


.byproduct-audit-popup-body {
  grid-template-columns: minmax(0, 1fr);
}

.byproduct-audit-popup-body .byproduct-audit-card {
  box-shadow: inset 3px 0 0 #188d8f, 0 2px 10px rgba(23, 32, 36, 0.06);
}

.byproduct-audit-empty {
  padding: 10px;
}
