:root {
  color: #20292e;
  background: #f2f5f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: linear-gradient(135deg, #f7f9f8 0%, #eef3f4 52%, #f6f2f8 100%); }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 3px solid #66b9c6; outline-offset: 2px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  padding: 12px max(24px, calc((100vw - 1420px) / 2));
  display: flex;
  align-items: center;
  gap: 28px;
  background: rgb(255 255 255 / 94%);
  border-bottom: 1px solid #d9e1e2;
  box-shadow: 0 4px 18px rgb(30 48 54 / 7%);
  backdrop-filter: blur(14px);
}

.topbar .tabs { margin-left: auto; }

.product-lockup { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.product-mark { width: 34px; height: 34px; display: flex; align-items: end; gap: 3px; padding: 7px; background: #233137; border-radius: 7px; box-shadow: 0 5px 12px rgb(35 49 55 / 20%); }
.product-mark span { width: 5px; border-radius: 2px 2px 0 0; }
.product-mark span:nth-child(1) { height: 11px; background: #54c4b4; }
.product-mark span:nth-child(2) { height: 19px; background: #f0ae49; }
.product-mark span:nth-child(3) { height: 15px; background: #9c80dc; }
.product-name { margin: 0; color: #233137; font-size: 19px; font-weight: 780; }
.focus-label, .eyebrow { margin: 3px 0 0; color: #6a777b; font-size: 12px; }

.search { min-width: min(360px, 100%); display: flex; align-items: center; gap: 8px; color: #46575b; font-size: 13px; font-weight: 720; }
.search label { flex: none; }
.search-field { position: relative; flex: 1; min-width: 180px; }
.search input { width: 100%; border: 1px solid #9db5b8; background: #fff; border-radius: 8px; padding: 11px 14px; color: #20292e; font-size: 15px; font-weight: 720; box-shadow: 0 3px 12px rgb(40 111 119 / 9%); transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease; }
.search input:hover, .search input:focus { border-color: #63aab3; background: #fff; box-shadow: 0 3px 12px rgb(40 111 119 / 10%); }
.suggestions { position: absolute; z-index: 12; left: 0; right: 0; top: calc(100% + 6px); overflow: hidden; background: #fff; border: 1px solid #d4dcdd; border-radius: 7px; box-shadow: 0 14px 30px rgb(30 48 54 / 16%); }
.suggestions:empty { display: none; }
.suggestions button { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf1f1; text-align: left; background: #fff; color: #293438; }
.suggestions button:last-child { border-bottom: 0; }
.suggestions button:hover, .suggestions button[aria-selected="true"] { background: #eaf6f4; }
.suggestion-heading { display: flex; align-items: baseline; gap: 12px; }
.suggestion-heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-kind { flex: none; margin-left: auto; color: #778487; font-size: 10px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.suggestion-description { display: block; margin-top: 3px; overflow: hidden; color: #617075; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

.workspace { max-width: 1420px; margin: auto; padding: 0 24px 32px; }
.controls { min-height: 64px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px; padding: 11px 0; border-bottom: 1px solid #d5dfe0; color: #536166; font-size: 13px; }
.tabs { display: inline-flex; border: 1px solid #c5d0d1; border-radius: 7px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgb(30 48 54 / 5%); }
.tabs button { min-height: 34px; padding: 7px 11px; border: 0; border-right: 1px solid #d6dede; background: transparent; color: #4b595d; transition: color 140ms ease, background 140ms ease; }
.tabs button:last-child { border-right: 0; }
.tabs button:hover { background: #edf4f4; }
.tabs button.active { background: #29383e; color: #fff; }

.direction-toggles { display: inline-flex; gap: 5px; margin: 0; padding: 0; border: 0; }
.direction-toggles legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.toggle-chip, .filter-chip { min-height: 34px; padding: 7px 11px; border: 1px solid #c9d3d4; border-radius: 7px; background: #fff; color: #536166; font-size: 12px; font-weight: 650; transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease; }
.toggle-chip:hover, .filter-chip:hover { border-color: #70abb2; transform: translateY(-1px); }
.toggle-chip.active { border-color: #4e9b9e; background: #ddf1ed; color: #246568; }
.toggle-chip:disabled { opacity: 1; }
.amount-control { display: flex; align-items: center; gap: 7px; }
.quantity-input { display: inline-flex; overflow: hidden; border: 1px solid #c5d0d1; border-radius: 7px; background: #fff; box-shadow: 0 1px 2px rgb(30 48 54 / 5%); }
.amount-input { width: 76px; height: 36px; padding: 7px 9px; border: 0; border-right: 1px solid #d6dede; background: #fff; color: #253237; font-weight: 720; }
.amount-input:hover, .amount-input:focus { border-color: #63aab3; }
.quantity-input:focus-within { outline: 3px solid #66b9c6; outline-offset: 2px; }
.quantity-input .amount-input:focus-visible, .quantity-input button:focus-visible { outline: 0; }
.quantity-input button { min-height: 34px; padding: 7px 10px; border: 0; border-right: 1px solid #d6dede; background: transparent; color: #4b595d; }
.quantity-input button:last-child { border-right: 0; }
.quantity-input button:hover { background: #edf4f4; }
.quantity-input button.active { background: #317f86; color: #fff; }
.control-label { color: #6b777b; font-size: 12px; font-weight: 650; }
.switch-control { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: #4d5b5f; font-size: 12px; font-weight: 650; }
.switch-control:disabled { opacity: .48; }
.switch-track { width: 38px; height: 22px; padding: 3px; display: block; background: #b8c3c5; border-radius: 11px; transition: background 160ms ease; }
.switch-track span { width: 16px; height: 16px; display: block; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgb(30 48 54 / 28%); transition: transform 160ms ease; }
.switch-control[aria-checked="true"] .switch-track { background: #3a9294; }
.switch-control[aria-checked="true"] .switch-track span { transform: translateX(16px); }

/* DLC needs far less width than the ten process kinds, so it takes a fraction of
   the row and wraps its five chips to the same height instead of reserving space
   the kind clusters can use. */
.filters { display: grid; grid-template-columns: minmax(290px, 1fr) minmax(180px, 0.3fr); align-items: stretch; gap: 10px 18px; padding: 10px 0; border-bottom: 1px solid #d5dfe0; }
/* Two columns: the chips take the width, and the summary pins to the top right on
   the legend's line rather than floating in the vertical middle of a wrapped row. */
.filter-group { min-width: 0; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 3px 8px 7px; border: 1px solid #d4dcdd; border-radius: 7px; background: rgb(255 255 255 / 55%); font-size: 12px; }
/* A rate basis hides the process kinds, leaving DLC as the row's only group. */
.filter-group:only-child { grid-column: 1 / -1; }
.filter-group legend { padding: 0 5px; color: #566469; font-weight: 720; }
/* The summary trails the chips on the same wrapping line: the page background is a
   gradient, so a badge riding on the group's border could not mask that border
   with any one colour, and a reserved column would starve the narrow DLC group of
   chip width. */
.filter-summary { margin-left: auto; display: flex; align-items: center; gap: 7px; padding-left: 4px; }
.filter-options { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 14px; }
/* A cluster keeps its kinds together as one wrappable unit and names the reason
   they belong together, so the ten kinds read as three short lists. */
.filter-cluster { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.filter-cluster-label { margin-right: 1px; color: #7f8b8e; font-size: 10px; font-weight: 720; letter-spacing: .04em; text-transform: uppercase; }
/* The kind chip and its disclosure are one segmented control: they share a border
   and touch, so the caret cannot be read as belonging to the next kind. */
.filter-kind { display: flex; align-items: stretch; }
.filter-kind .filter-chip.family-kind { border-radius: 7px; }
.filter-kind:has(.filter-disclosure) .filter-chip.family-kind { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.filter-chip { min-height: 30px; padding: 5px 9px; }
/* A kind chip carries heading weight and a tinted face; a mechanism chip is a
   smaller pill. Shape and weight carry the relationship, so it survives without
   depending on colour alone. */
.filter-chip.family-kind { border-color: #b3c3c6; background: #e7eef0; color: #33474c; font-weight: 730; }
.filter-chip.family-mechanism { min-height: 26px; padding: 4px 9px; border-color: #d5dedf; border-radius: 999px; font-size: 11px; font-weight: 620; }
/* Inclusion and exclusion must be told apart without colour, so an included chip
   is a filled face and an excluded one is struck through behind its minus sign. */
.filter-chip.state-include, .filter-chip.active { border-color: #9877c3; background: #eee7f8; color: #684694; }
.filter-chip.state-exclude { border-color: #d08d92; background: #fbeced; color: #97444d; text-decoration: line-through; text-decoration-thickness: 1px; }
.filter-disclosure { min-width: 20px; padding: 0 4px; border: 1px solid #b3c3c6; border-left-width: 0; border-radius: 0 7px 7px 0; background: #e7eef0; color: #5d6f73; font-size: 9px; font-weight: 700; line-height: 1; }
.filter-disclosure:hover { background: #d9e4e7; color: #2f6a70; }
.filter-kind.open .filter-disclosure { background: #c9d7da; color: #2c4146; }
/* An open kind's mechanisms sit on their own line below the kind grid, so the
   grid never reflows; the strip names the kind it narrows because it is no longer
   adjacent to that chip. */
.filter-narrowings { display: flex; flex-direction: column; gap: 3px; margin-top: 1px; padding-top: 5px; border-top: 1px solid #dee6e7; }
.filter-narrowing { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.filter-narrowing-label { min-width: 92px; color: #4c5c60; font-size: 11px; font-weight: 730; }
/* The summary is status text and Reset is an action, so they must not look alike:
   the count stays unboxed muted text and the button gets a chip's face. */
.filter-state { color: #7a8588; white-space: nowrap; }
.clear-filter { min-height: 24px; padding: 4px 9px; border: 1px solid #cbd5d6; border-radius: 6px; background: #fff; color: #477b82; font-size: 11px; font-weight: 700; transition: border-color 140ms ease, color 140ms ease, background 140ms ease; }
.clear-filter:hover:not(:disabled) { border-color: #70abb2; background: #f1f9f9; color: #255f66; }
.clear-filter:disabled { border-color: #e1e7e7; background: rgb(255 255 255 / 40%); color: #a9b1b2; }

.status, .warning, .error { margin: 10px 0 0; padding: 9px 11px; border-left: 3px solid #3b9192; border-radius: 0 5px 5px 0; background: #e4f3f0; color: #35575a; font-size: 13px; }
.warning { border-color: #db9841; background: #fff1d9; color: #745221; }
.error { border-color: #d65858; background: #fae6e4; color: #7a3333; }
.graph-summary { margin: 10px 0 0; padding: 8px 11px; border: 1px solid #cfdbdc; border-radius: 6px; background: rgb(255 255 255 / 68%); color: #53666a; font-size: 12px; }
.explorer-heading { margin: 14px 0 0; color: #5d6b6f; font-size: 14px; font-weight: 520; }
.explorer-heading strong { color: #26353a; font-size: 16px; font-weight: 760; }

.content { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
.diagram-shell { min-width: 0; overflow: hidden; background: #fff; border: 1px solid #d5ddde; border-radius: 8px; box-shadow: 0 8px 24px rgb(32 51 57 / 7%); }
.diagram-note { margin: 0; padding: 9px 12px; color: #735326; background: #fff5df; border-bottom: 1px solid #eeddbb; font-size: 12px; }
.route-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.route-path { min-width: 0; display: flex; align-items: center; gap: 7px; overflow-x: auto; }
.route-step { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.route-path strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-arrow { flex: 0 0 auto; color: #b47d2c; font-size: 15px; line-height: 1; }
.route-note button { flex: 0 1 auto; max-width: 46%; overflow: hidden; padding: 3px 7px; border: 0; background: transparent; color: #356f75; font-size: 11px; font-weight: 720; text-decoration: underline; text-overflow: ellipsis; white-space: nowrap; }
.diagram-camera { position: relative; height: min(72vh, 760px); min-height: 440px; overflow: hidden; background: #fcfdfd; }
.diagram { display: block; width: 100%; height: 100%; background-color: #fcfdfd; background-image: linear-gradient(#edf2f2 1px, transparent 1px), linear-gradient(90deg, #edf2f2 1px, transparent 1px); background-size: 28px 28px; cursor: grab; touch-action: none; }
.diagram:active { cursor: grabbing; }
.camera-controls { position: absolute; z-index: 2; right: 12px; top: 12px; display: flex; overflow: hidden; border: 1px solid #bdcacc; border-radius: 7px; background: rgb(255 255 255 / 94%); box-shadow: 0 3px 10px rgb(31 52 58 / 12%); }
.camera-controls button { min-width: 34px; min-height: 34px; padding: 5px 9px; border: 0; border-right: 1px solid #d4dddd; background: transparent; color: #34464b; font-size: 16px; font-weight: 760; }
.camera-controls button:last-child { border-right: 0; }
.camera-controls button:hover { background: #e8f3f2; color: #17666b; }
.camera-controls .fit { font-size: 11px; }
.camera-hint { position: absolute; z-index: 1; right: 12px; bottom: 10px; margin: 0; padding: 4px 7px; border-radius: 4px; background: rgb(255 255 255 / 82%); color: #68777a; font-size: 10px; pointer-events: none; }
.link { fill: none; opacity: .68; transition: opacity 180ms ease, filter 180ms ease; }
.link.sankey { opacity: .64; }
.link.sankey.dimension-item, .link.sankey.dimension-item-rate { stroke-dasharray: 8 3; opacity: .7; }
.link.sankey.dimension-calorie, .link.sankey.dimension-calorie-rate { stroke-dasharray: 14 4 3 4; opacity: .78; }
.link.sankey.dimension-radbolt, .link.sankey.dimension-radbolt-rate { stroke-dasharray: 3 4; stroke-linecap: round; opacity: .84; }
.link.sankey.dimension-germ, .link.sankey.dimension-germ-rate { stroke-dasharray: 1 5; stroke-linecap: round; }
.link.sankey.secondary { opacity: .36; }
.fold-connector { stroke: #735f96; stroke-dasharray: 5 5; stroke-linecap: round; opacity: .78; }
.alternative-connector { fill: none; stroke: #8a72b4; stroke-dasharray: 2 4; stroke-linecap: round; opacity: .72; }
.process-fold-group > rect { fill: rgb(115 95 150 / 7%); stroke: #8b78aa; stroke-width: 1.5; stroke-dasharray: 6 4; pointer-events: none; }
.process-fold-group.selected > rect { stroke: #db4656; stroke-width: 3; filter: drop-shadow(0 2px 4px rgb(219 70 86 / 24%)); }
.process-fold-header { width: 100%; height: 24px; display: flex; align-items: center; gap: 6px; overflow: hidden; padding: 2px 7px; border: 1px solid rgb(115 95 150 / 34%); border-radius: 5px; background: rgb(250 248 253 / 96%); color: #493c61; font: 700 10px/1.1 Inter, ui-sans-serif, system-ui, sans-serif; text-align: left; }
.process-fold-header span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.process-fold-header span:nth-child(2) { margin-left: auto; color: #78698f; font-weight: 620; white-space: nowrap; }
.process-fold-header span:last-child { font-size: 15px; line-height: 1; }
.process-fold-header:hover, .process-fold-header:focus-visible { border-color: #735f96; background: #f1ebf8; color: #38294f; }
.cycle-link { fill: none; stroke: #d48a38; stroke-width: 2; stroke-dasharray: 5 4; opacity: .72; transition: opacity 180ms ease; }
.selection-active .link, .selection-active .cycle-link { opacity: .08; }
.selection-active .link.emphasized { opacity: .88; filter: drop-shadow(0 1px 2px rgb(32 45 50 / 24%)); }
.selection-active .link.sankey.secondary.emphasized { opacity: .62; }
.selection-active .cycle-link.emphasized { opacity: .9; }
.relationship-quantity { fill: #26343a; stroke: #fff; stroke-width: 4px; paint-order: stroke; font-size: 11px; font-weight: 760; pointer-events: none; transition: opacity 180ms ease; }
.selection-active .relationship-quantity { opacity: .08; }
.selection-active .relationship-quantity.emphasized { opacity: 1; }
.node { transition: opacity 180ms ease; }
.node-shape { cursor: pointer; }
.selection-active .node { opacity: .18; }
.selection-active .node.emphasized { opacity: 1; }
.node rect { fill: color-mix(in srgb, var(--node-color) 24%, white); stroke: var(--node-color); stroke-width: 1.6; transition: fill 160ms ease, stroke-width 160ms ease, filter 160ms ease; }
.sankey .node rect { fill: var(--node-color); stroke: color-mix(in srgb, var(--node-color) 70%, #26343a); }
.node.fold rect { fill: color-mix(in srgb, var(--node-color) 12%, white); stroke-dasharray: 5 4; }
/* An alternative is a choice the graph has not explored, so it reads lighter
   than the materials that carry a quantity. */
.node.alternative rect { fill: color-mix(in srgb, var(--node-color) 14%, white); stroke-dasharray: 2 3; stroke-width: 1.2; }
.sankey .node.alternative rect { fill: var(--node-color); opacity: .55; }
.node.alternative .node-button { font-weight: 620; font-style: italic; }
.node.process.passive rect { stroke-dasharray: 4 3; }
.sankey .node.fold rect { fill: var(--node-color); opacity: .78; }
.node.fold .node-button { color: #493c61; }
.node.selected rect { stroke: #db4656; stroke-width: 4; filter: drop-shadow(0 2px 4px rgb(219 70 86 / 32%)); }
.node[data-focus-node="true"] rect { stroke: #167f82; stroke-width: 3; filter: drop-shadow(0 0 6px rgb(22 127 130 / 38%)); }
.camera-focus-pulse rect { animation: camera-focus-pulse 900ms ease-out; }
@keyframes camera-focus-pulse { 0%, 100% { filter: none; } 28% { filter: drop-shadow(0 0 7px #27a5a8); } }
.node-button { width: 100%; height: 100%; padding: 6px 8px; border: 0; background: transparent; color: #263238; text-align: left; font-size: 12px; font-weight: 700; overflow: hidden; }
.node-button:hover { color: #0f636b; }
.node-button .node-primary-label, .node-button .node-secondary-label, .node-button .node-disambiguation-label { display: block; overflow: hidden; text-overflow: ellipsis; }
.node-button .node-secondary-label { margin-top: 2px; color: #536267; font-size: 0.9em; font-weight: 620; }
.node-button .node-disambiguation-label { margin-top: 3px; color: #788488; font-size: 0.78em; font-weight: 520; }
.node-card { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: stretch; overflow: hidden; }
.node-card > .node-button { min-height: 0; flex: 1; }
.starting-point-badge { min-height: 18px; flex: 0 0 18px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 2px 6px; border-top: 1px solid rgb(22 127 130 / 28%); background: #d9f1ed; color: #17686b; font-size: 9px; font-weight: 780; line-height: 1; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.sankey-label-card .starting-point-badge { padding-inline: 2px; font-size: 8px; letter-spacing: 0; }
.expansion-action { min-height: 22px; overflow: hidden; padding: 1px 7px 2px; border: 0; border-top: 1px solid rgb(77 132 137 / 30%); background: #d7f0ec; color: #17666b; font-size: 14px; font-weight: 850; line-height: 1; text-align: center; white-space: nowrap; }
.expansion-action:hover, .expansion-action:focus-visible { background: #bfe4df; color: #0b555a; }
.expansion-action.collapse { background: #e5ebeb; color: #44575a; font-size: 17px; }
.expansion-action.category { border-top-color: rgb(105 83 153 / 32%); background: #eee8fa; color: #57417e; }
.node-button.sankey-label { width: auto; height: auto; min-height: calc(28px * var(--sankey-node-label-scale, var(--sankey-label-scale, 1))); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: calc(4px * var(--sankey-node-label-scale, var(--sankey-label-scale, 1))) calc(6px * var(--sankey-node-label-scale, var(--sankey-label-scale, 1))); line-height: 1.2; font-size: calc(12px * var(--sankey-node-label-scale, var(--sankey-label-scale, 1))); white-space: nowrap; background: rgb(255 255 255 / 88%); border-radius: 4px; }
.node-button.sankey-label.left { align-items: flex-end; text-align: right; }
.sankey-label-card { width: max-content; max-width: 100%; height: auto; border-radius: 4px; background: rgb(255 255 255 / 90%); }
.sankey-label-card.left { margin-left: auto; }
.sankey-label-card.right { margin-right: auto; }
.sankey-label-card .node-button.sankey-label { width: auto; }
.sankey-label-card .expansion-action { border-radius: 0 0 4px 4px; }
.sankey-quantity { fill: #26343a; stroke: #fff; stroke-width: calc(4px * var(--sankey-label-scale, 1)); paint-order: stroke; font-size: calc(12px * var(--sankey-label-scale, 1)); font-weight: 780; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .camera-focus-pulse rect { animation: none; }
}

.transformation-browser { min-height: 440px; overflow: hidden; background: #fff; border: 1px solid #d5ddde; border-radius: 8px; box-shadow: 0 8px 24px rgb(32 51 57 / 7%); }
.inventory-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 18px 20px 12px; border-bottom: 1px solid #dfe6e6; }
.inventory-toolbar h2 { margin: 0; font-size: 18px; }
.inventory-toolbar p { margin: 4px 0 0; color: #6b797c; font-size: 12px; }
.inventory-toolbar label { min-width: min(340px, 46%); display: grid; gap: 5px; color: #59676b; font-size: 11px; font-weight: 720; }
.inventory-toolbar input { width: 100%; padding: 9px 10px; border: 1px solid #aebfc1; border-radius: 6px; background: #fff; }
.inventory-count { margin: 0; padding: 8px 20px; background: #f6f9f9; color: #6b797c; font-size: 11px; }
.transformation-table-scroll { overflow: auto; max-height: min(72vh, 840px); }
.transformation-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.transformation-table th, .transformation-table td { padding: 10px 12px; border-top: 1px solid #e2e8e8; text-align: left; vertical-align: top; }
.transformation-table thead th { position: sticky; top: 0; z-index: 1; border-top: 0; background: #eef3f3; color: #526165; font-size: 10px; text-transform: uppercase; }
.transformation-table tbody th { width: 22%; }
.transformation-table tbody tr.selected { background: #fff3f4; box-shadow: inset 3px 0 #db4656; }
.transformation-table button { padding: 0; border: 0; background: transparent; color: #276f76; font-weight: 720; text-align: left; }
.transformation-table button:hover { text-decoration: underline; }
.transformation-table .process-title small { display: block; margin-top: 2px; color: #68767a; font-size: 10px; font-weight: 560; }
.transformation-table .process-title .process-disambiguation { color: #899296; font-weight: 480; }
.table-flow-list { min-width: 170px; margin: 0; padding: 0; list-style: none; }
.table-flow-list li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.table-flow-list span { color: #677579; white-space: nowrap; }
.table-flow-list li.table-flow-alternatives { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px dashed #d3dcdc; }
.table-flow-alternatives .alternatives-label { display: block; color: #7d8a8d; font-size: 10px; font-weight: 640; text-transform: uppercase; white-space: normal; }
.table-flow-alternatives ul { margin: 2px 0 0; padding: 0; list-style: none; }
.table-flow-alternatives ul li { display: block; padding: 1px 0; color: #526165; }

/* A folded variant group owns its members: the group row carries the tinted band
   and the members are indented beneath it, so the two never read as siblings. */
.transformation-table tbody tr.variant-group { background: #f4f8f8; }
.transformation-table tbody tr.variant-group > * { border-top-color: #cfdada; }
.transformation-table tbody tr.variant-group.open > * { border-bottom: 0; }
.transformation-table tbody tr.variant-member { background: #fbfdfd; }
.transformation-table tbody tr.variant-member > * { border-top-style: dotted; }
.transformation-table tbody tr.variant-member > th { padding-left: 30px; box-shadow: inset 3px 0 #cfdada; }
.variant-toggle { display: flex; gap: 6px; align-items: flex-start; width: 100%; }
.variant-heading { display: block; }
.variant-heading small { display: block; margin-top: 2px; color: #68767a; font-size: 10px; font-weight: 560; }
.variant-heading .variant-count { color: #276f76; font-weight: 640; }
.variant-caret { flex: 0 0 auto; margin-top: 3px; border: 4px solid transparent; border-left-color: #276f76; }
tr.variant-group.open .variant-caret { margin-top: 5px; border-left-color: transparent; border-top-color: #276f76; }
.inventory-empty { padding: 42px 20px; color: #748083; text-align: center; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.detail-panel { position: fixed; z-index: 11; width: 284px; max-height: var(--detail-max-height, calc(100vh - 24px)); overflow: auto; pointer-events: none; padding: 16px; background: rgb(255 255 255 / 92%); border: 1px solid #d5ddde; border-radius: 8px; box-shadow: 0 8px 24px rgb(32 51 57 / 12%); backdrop-filter: blur(8px); }
.detail-panel h2 { margin: 4px 0 10px; color: #253237; font-size: 18px; }
.detail-panel p { color: #5b696d; font-size: 13px; }
.detail-panel .dlc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: -3px 0 10px; }
.detail-panel .dlc-tag { padding: 3px 7px; border: 1px solid #cfc0e3; border-radius: 999px; background: #f3eef9; color: #684694; font-size: 10px; font-weight: 700; line-height: 1.2; }
.detail-panel .dlc-tag.excluded { border-color: #d7c9c9; background: #f7f2f2; color: #7b5b5b; }
.detail-panel .process-operation { margin: -6px 0 0; color: #445358; font-weight: 650; }
.detail-panel .process-disambiguation { margin: 4px 0 0; color: #7a8588; font-size: 11px; }
.detail-panel dl { margin: 16px 0 0; }
.detail-panel dt { margin-top: 11px; color: #7a8588; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.detail-panel dd { margin: 3px 0 0; color: #384448; font-size: 12px; word-break: break-word; }
.detail-panel h3 { margin: 16px 0 6px; color: #717e81; font-size: 11px; text-transform: uppercase; }
.flow-list { margin: 0; padding: 0; list-style: none; }
.flow-list li { min-height: 32px; padding: 7px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-top: 1px solid #e2e8e8; font-size: 12px; }
.flow-list small { display: block; margin-top: 3px; color: #7a8588; font-size: 10px; line-height: 1.35; }
.flow-list strong { color: #317e86; font-size: 11px; white-space: nowrap; }
.flow-list.output-list strong { color: #7555a5; }
.empty-state { min-height: 440px; display: grid; place-items: center; color: #748083; background: #fff; border: 1px solid #d5ddde; border-radius: 8px; }

@media (max-width: 1100px) {
  .search { min-width: 300px; }
}

@media (max-width: 760px) {
  .topbar { position: static; flex-wrap: wrap; padding: 14px 16px; }
  .workspace { padding: 0 14px 22px; }
  .controls { gap: 10px 12px; }
  .search { width: 100%; min-width: 0; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; }
  .filters { grid-template-columns: minmax(0, 1fr); }
  .filter-group { min-width: 100%; }
  /* A cluster takes its own row so its label reads as the heading of the kinds
     that follow rather than as a separator between two clusters. */
  .filter-cluster { flex: 1 0 100%; }
  .filter-narrowing-label { flex: 1 0 100%; min-width: 0; }
  .detail-panel { position: static; width: 100%; max-height: none; margin-bottom: 12px; pointer-events: auto; order: -1; }
  .diagram-camera { height: 62vh; min-height: 390px; }
  .inventory-toolbar { align-items: stretch; flex-direction: column; }
  .inventory-toolbar label { width: 100%; min-width: 0; }
}
