/* ── Reset & base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --surface2:  #22263a;
  --border:    #2e3352;
  --accent:    #f8a31a;
  --accent2:   #4fa3e0;
  --text:      #e2e6f0;
  --muted:     #6b7294;
  --danger:    #e05050;
  --success:   #4caf50;
  --alt-badge: #9b59b6;
  --radius:    8px;
  --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  padding: 1rem 2rem;
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}
.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.tagline { color: var(--muted); font-size: 0.9rem; }

/* ── Main layout ─────────────────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Panel ───────────────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.panel h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.panel h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent2);
  margin: 1.5rem 0 0.75rem;
}
.panel h3:first-of-type { margin-top: 0.5rem; }

.hidden { display: none !important; }

/* ── Target rows ─────────────────────────────────────────────────────────────── */
#target-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.target-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  position: relative;
}
.item-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color .15s;
}
.item-input:focus { border-color: var(--accent); }
.rate-input {
  width: 130px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color .15s;
}
.rate-input:focus { border-color: var(--accent); }

/* ── Autocomplete ────────────────────────────────────────────────────────────── */
.autocomplete-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  width: calc(100% - 140px - 2.5rem);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  list-style: none;
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.autocomplete-list li {
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
}
.autocomplete-list li:hover,
.autocomplete-list li.active {
  background: var(--border);
  color: var(--accent);
}
.autocomplete-list mark {
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: var(--surface2);
  color: var(--accent2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color .15s;
}
.btn-secondary:hover { border-color: var(--accent2); }
.btn-remove {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  transition: color .15s, border-color .15s;
}
.btn-remove:hover { color: var(--danger); border-color: var(--danger); }

.solve-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}
.toggle-label input { accent-color: var(--accent); }

/* ── Summary cards ───────────────────────────────────────────────────────────── */
.cards-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  min-width: 150px;
  text-align: center;
}
.card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.card-label {
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 0.2rem;
}
.card-sub { font-size: 0.75rem; color: var(--muted); }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
thead { background: var(--surface2); }
th {
  text-align: left;
  padding: 0.55rem 0.85rem;
  color: var(--accent2);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.4;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.03); }

.muted { color: var(--muted); font-size: 0.82em; }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge-alt {
  display: inline-block;
  background: var(--alt-badge);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.3em;
}

/* Belt badges */
.belt-badge {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.belt-badge.belt-1 { color: #9e9e9e; border-color: #9e9e9e; }
.belt-badge.belt-2 { color: #4caf50; border-color: #4caf50; }
.belt-badge.belt-3 { color: #2196f3; border-color: #2196f3; }
.belt-badge.belt-4 { color: #ff9800; border-color: #ff9800; }
.belt-badge.belt-5 { color: #e91e63; border-color: #e91e63; }
.belt-badge.belt-6 { color: #9c27b0; border-color: #9c27b0; }

/* ── Tier list ───────────────────────────────────────────────────────────────── */
.tier-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tier-list li {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3em 0.85em;
  font-size: 0.82rem;
  color: var(--accent2);
}

/* ── Alternates panel ────────────────────────────────────────────────────────── */
.hint { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
#alternates-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.alt-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.alt-row label {
  min-width: 200px;
  font-size: 0.88rem;
  color: var(--text);
}
.alt-row select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  flex: 1;
  max-width: 400px;
}
.alt-row select:focus { border-color: var(--accent); }

/* ── Error banner ────────────────────────────────────────────────────────────── */
.error-banner {
  background: rgba(224,80,80,.15);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  padding: 0.85rem 1.2rem;
  font-size: 0.88rem;
  white-space: pre-line;
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Clock speed controls ────────────────────────────────────────────────────── */
.clock-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.clock-mode-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.clock-label {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.clock-opt-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.clock-opt-label input[type="radio"] { accent-color: var(--accent); }
.clock-opt-label .hint-text {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}
.clock-pref-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-wrap: wrap;
}
.pref-edge {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  min-width: 90px;
}
.pref-edge.right { text-align: center; }
.pref-slider {
  flex: 1;
  min-width: 120px;
  accent-color: var(--accent);
  cursor: pointer;
}
.pref-val {
  font-size: 0.78rem;
  color: var(--accent2);
  min-width: 130px;
  text-align: center;
}

/* ── Clock result badges ─────────────────────────────────────────────────────── */
.badge-round {
  display: inline-block;
  background: rgba(76,175,80,.18);
  color: #4caf50;
  border: 1px solid #4caf50;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.3em;
}
.badge-oc {
  display: inline-block;
  background: rgba(255,152,0,.15);
  color: #ff9800;
  border: 1px solid #ff9800;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.2em;
}
.clock-round {
  color: #4caf50;
  font-weight: 600;
}

/* ── Flow diagram ────────────────────────────────────────────────────────────── */
.diagram-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0;
}
.diagram-hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}
.btn-sm {
  font-size: 0.82rem;
  padding: 0.3rem 0.8rem;
}
#diagram-toggle-icon {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.7rem;
}
#diagram-toggle-icon.open {
  transform: rotate(90deg);
}
#layout-toggle-icon {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.7rem;
}
#layout-toggle-icon.open {
  transform: rotate(90deg);
}
.diagram-wrapper {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
  max-height: 70vh;
  background: #0f111a;
}
/* Flow diagram wrapper overrides: fixed height, no scroll — zoom/pan instead */
#diagram-wrapper {
  overflow: hidden;
  max-height: none;
}
.diagram-container {
  min-width: 600px;
  padding: 0;
}
.graph-svg {
  display: block;
  width: 100%;
  height: 600px;
  cursor: grab;
}
.graph-svg:active {
  cursor: grabbing;
}

/* ── Graph toolbar ───────────────────────────────────────────────────────── */
.graph-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 10px;
  background: #13162200;
  border-bottom: 1px solid var(--border);
}
.gt-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gt-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 2px;
}
.gt-label {
  font-size: 0.75rem;
  color: var(--muted);
  padding-right: 2px;
}
.gt-btn {
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
}
.gt-btn:hover {
  background: var(--surface3, #2a2d3e);
  border-color: var(--accent);
}
.gt-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.gt-pill.active {
  background: var(--surface3, #2a2d3e);
  color: var(--text);
  border-color: var(--accent);
}
.gt-pill:hover {
  border-color: var(--accent);
}
.gt-focus-label {
  font-size: 0.75rem;
  color: var(--accent);
}
.gt-clear-focus {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Focus dimming ───────────────────────────────────────────────────────── */
.graph-svg.focus-active .graph-node:not(.focus-connected) {
  opacity: 0.1;
  pointer-events: none;
}
.graph-svg.focus-active .graph-edge:not(.focus-connected) {
  opacity: 0.06;
}

/* ── Focus directional coloring ──────────────────────────────────────────── */
/* Node border/fill tints — placed before edge-hover so hover wins (same specificity, later rule) */
/* focused self — white so it's visually distinct from the orange upstream cluster */
.graph-svg.focus-active .graph-node.focus-self rect:first-child {
  stroke: #ffffff !important;
  stroke-width: 2.5px !important;
  fill: rgba(255, 255, 255, 0.15) !important;
}
.graph-svg.focus-active .graph-node.focus-self rect:nth-child(2) {
  fill: #ffffff !important;
}
/* upstream — orange input tint */
.graph-svg.focus-active .graph-node.focus-upstream rect:first-child {
  stroke: #FF8C00 !important;
  fill: rgba(255, 140, 0, 0.14) !important;
}
/* downstream — cyan output tint, recolor bar to match */
.graph-svg.focus-active .graph-node.focus-downstream rect:first-child {
  stroke: #00C2FF !important;
  fill: rgba(0, 194, 255, 0.14) !important;
}
.graph-svg.focus-active .graph-node.focus-downstream rect:nth-child(2) {
  fill: #00C2FF !important;
}
/* cycle — purple */
.graph-svg.focus-active .graph-node.focus-cycle rect:first-child {
  stroke: #cc88ff !important;
  fill: rgba(200, 130, 255, 0.14) !important;
}
.graph-svg.focus-active .graph-node.focus-cycle rect:nth-child(2) {
  fill: #cc88ff !important;
}

/* Edge stroke colors by direction */
.graph-edge.focus-edge-up path {
  stroke: #FF8C00 !important;
  stroke-opacity: 1 !important;
  stroke-width: 2px !important;
}
.graph-edge.focus-edge-down path {
  stroke: #00C2FF !important;
  stroke-opacity: 1 !important;
  stroke-width: 2px !important;
}
.graph-edge.focus-edge-cycle path {
  stroke: #cc88ff !important;
  stroke-opacity: 1 !important;
  stroke-width: 2px !important;
}

/* ── Edge hover highlight ────────────────────────────────────────────────── */
.graph-edge.edge-hover path {
  stroke: var(--accent) !important;
  stroke-width: 2.5 !important;
  stroke-opacity: 1 !important;
}
.graph-edge.edge-hover text {
  fill: var(--accent) !important;
  opacity: 1 !important;
}
.layout-svg {
  display: block;
}
.graph-node {
  cursor: default;
}
.graph-node rect {
  transition: filter 0.15s;
}
.graph-node:hover rect {
  filter: brightness(1.25);
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  header { flex-direction: column; gap: 0.25rem; padding: 1rem; }
  .solve-row { flex-direction: column; align-items: flex-start; }
  .cards-row .card { flex: 1; min-width: 120px; }
  .alt-row { flex-direction: column; align-items: flex-start; }
  .alt-row select { max-width: 100%; width: 100%; }
}

/* ── Materials Reference Grid ─────────────────────────────────────────────────── */
.materials-wrapper {
  overflow: hidden;
}
.materials-outer {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.materials-grid {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: max-content;
  padding: 0.5rem 0 0.25rem;
}
.mat-stage-col {
  width: 156px;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 6px 6px;
}
.mat-stage-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  padding: 2px 0 0;
}
.mat-stage-raw .mat-stage-header { color: var(--success); }
.mat-stage-sub {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 5px;
  min-height: 1em;
}
.mat-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  cursor: default;
  transition: border-color 0.1s;
}
.mat-item:hover { border-color: var(--accent); }
.mat-item-raw {
  border-color: #2a5c3a;
  background: #0c1a10;
}
.mat-item-raw:hover { border-color: var(--success); }
.mat-item-name {
  font-size: 0.76rem;
  color: var(--text);
  line-height: 1.25;
}
.mat-item-sub {
  font-size: 0.67rem;
  color: var(--muted);
  margin-top: 1px;
}

/* ── Byproduct disposal section ──────────────────────────────────────────────── */
.badge-fluid {
  display: inline-block;
  background: rgba(79, 163, 224, 0.15);
  color: var(--accent2);
  border: 1px solid var(--accent2);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-solid {
  display: inline-block;
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid #4caf50;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  white-space: nowrap;
}
.disposal-sink    { color: #4caf50; font-size: 0.85rem; }
.disposal-package { color: var(--accent); font-size: 0.85rem; }
.disposal-drain   { color: var(--muted); font-size: 0.85rem; }

/* ── .sfmd import ────────────────────────────────────────────────────────────── */
.panel-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.panel-header-row h2 {
  margin: 0;
  flex: 1;
}
#targets-panel.drop-active {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
  background: rgba(248, 163, 26, 0.04);
}

/* ── Clickable table rows ────────────────────────────────────────────────────── */
tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover td { background: rgba(248,163,26,0.07); }
.row-alt-hint {
  font-size: 0.65rem;
  color: var(--muted);
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.7;
}

/* ── Floating recipe picker ──────────────────────────────────────────────────── */
.recipe-picker {
  position: fixed;
  z-index: 1000;
  width: 340px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.recipe-picker.hidden { display: none; }
.rp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rp-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
}
.rp-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.rp-close:hover { color: var(--text); }
.rp-list {
  overflow-y: auto;
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rp-option {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.rp-option:hover { border-color: var(--accent); background: var(--surface2); }
.rp-option.rp-active {
  border-color: var(--accent);
  background: rgba(248,163,26,0.1);
}
.rp-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.rp-machine {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.rp-rates {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.rp-input  { color: #7ab3e0; }
.rp-output { color: #7ec87e; }
.rp-sep    { color: var(--border); padding: 0 2px; }
.rp-unlock {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 3px;
  font-style: italic;
}

/* ── SVG + overlay dock wrapper ──────────────────────────────────────────────── */
.graph-svg-wrapper {
  position: relative;
}

/* ── Docked node info panel — overlaid at bottom of SVG ─────────────────────── */
.graph-info-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 14px 8px;
  background: rgba(10, 12, 22, 0.88);
  backdrop-filter: blur(4px);
  border-top: 1px solid var(--border);
  font-size: 0.77rem;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.graph-info-dock.dock-populated {
  opacity: 1;
}
.gid-empty {
  color: var(--muted);
  font-style: italic;
}
.gid-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  flex-shrink: 0;
}
.gid-recipe  { font-weight: 700; color: var(--accent); }
.gid-machine { color: var(--text); }
.gid-power   { color: var(--muted); }
.gid-sep     { color: var(--border); }

/* Two-column input/output layout */
.gid-cols {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.gid-col-in, .gid-col-out {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}
.gid-col-div {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0 8px;
  flex-shrink: 0;
}
.gid-in-line {
  font-size: 0.72rem;
  color: #c07830;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gid-dest-line {
  font-size: 0.72rem;
  color: var(--accent2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gid-dest-sink { color: var(--success); font-style: italic; }
.gid-more      { color: var(--muted);   font-style: italic; font-size: 0.68rem; }
