.assembly-overlay {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(6, 10, 16, 0.82);
  z-index: 2200;
  font-family: Arial, sans-serif;
  color: #eef8ff;
}

.assembly-overlay.visible {
  display: flex;
}

.assembly-picker-wrap {
  width: min(860px, 94vw);
  margin: auto;
  background: linear-gradient(180deg, #0f1823 0%, #09111a 100%);
  border: 1px solid rgba(117, 197, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  padding: 22px;
}

.assembly-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.assembly-picker-head h2,
.assembly-builder-top h2 {
  margin: 0;
  font-size: 28px;
}

.assembly-close-btn,
.assembly-action-btn,
.assembly-project-open-btn,
.assembly-part-btn {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
}

.assembly-close-btn {
  width: 42px;
  height: 42px;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef8ff;
}

.assembly-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.assembly-picker-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.assembly-panel {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 16px;
}

.assembly-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8ddcff;
  margin-bottom: 10px;
}

.assembly-new-project-input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  padding: 0 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #eef8ff;
  outline: none;
}

.assembly-new-project-input:focus {
  border-color: rgba(53, 184, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(53, 184, 255, 0.12);
}

.assembly-action-btn {
  width: 100%;
  height: 42px;
  font-weight: 800;
  background: #35b8ff;
  color: #07131c;
}

.assembly-action-btn:hover {
  filter: brightness(1.05);
}

.assembly-action-btn--compact {
  width: auto;
  padding: 0 14px;
}

.assembly-project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assembly-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.assembly-project-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.assembly-project-meta {
  font-size: 12px;
  opacity: 0.72;
}

.assembly-project-open-btn {
  padding: 10px 12px;
  background: rgba(53, 184, 255, 0.16);
  color: #bdeaff;
  font-weight: 700;
}

.assembly-project-open-btn:hover {
  background: rgba(53, 184, 255, 0.24);
}

.assembly-builder-shell {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.assembly-builder-shell.visible {
  display: flex;
}

.assembly-builder-top {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: rgba(7, 12, 18, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.assembly-builder-top-actions {
  display: flex;
  gap: 10px;
}

.assembly-builder-subtitle {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8ddcff;
}

.assembly-builder-main {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  min-height: 0;
}

.assembly-sidebar,
.assembly-inspector {
  background: rgba(8, 14, 22, 0.94);
  overflow: auto;
  padding: 16px;
  min-width: 0;
}

.assembly-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.assembly-sidebar.remove-hover {
  box-shadow: inset 0 0 0 2px rgba(80, 220, 140, 0.9);
  background: rgba(40, 120, 70, 0.18);
}

.assembly-inspector {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.assembly-viewport-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: linear-gradient(180deg, #101824 0%, #0a121a 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.assembly-viewport-wrap.drop-hover {
  box-shadow: inset 0 0 0 2px rgba(53, 184, 255, 0.78);
}

.assembly-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.assembly-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.assembly-viewport-hint {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.38);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}

.assembly-transform-readout {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: none;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  pointer-events: none;
}

.assembly-transform-readout.visible {
  display: block;
}

.assembly-part-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assembly-part-btn {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #eef8ff;
  text-align: left;
  cursor: grab;
  user-select: none;
}

.assembly-part-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.assembly-part-btn:active {
  cursor: grabbing;
}

.assembly-part-btn.active {
  outline: 2px solid rgba(53, 184, 255, 0.75);
  background: rgba(53, 184, 255, 0.08);
}

.assembly-part-thumb {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.assembly-part-name {
  font-weight: 700;
  margin-bottom: 4px;
}

.assembly-part-meta {
  font-size: 12px;
  opacity: 0.76;
}

.assembly-empty {
  padding: 10px 0;
  opacity: 0.7;
}

.assembly-inspector-block + .assembly-inspector-block {
  margin-top: 16px;
}

.assembly-inspector-title {
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8ddcff;
}

.assembly-log {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  word-break: break-word;
}

.assembly-selected-subtitle {
  margin-top: 6px;
  opacity: 0.78;
}

.assembly-selected-coords {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.76;
}

.assembly-selected-label-field {
  margin-top: 12px;
}

.assembly-palette-ghost {
  position: fixed;
  z-index: 2600;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(117, 197, 255, 0.28);
  border-radius: 12px;
  background: rgba(10, 18, 28, 0.94);
  color: #eef8ff;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.assembly-palette-ghost.visible {
  display: flex;
}

.assembly-palette-ghost img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.assembly-transform-panel {
  margin-top: 14px;
}

.assembly-transform-panel.is-disabled {
  opacity: 0.5;
}

.assembly-transform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.assembly-transform-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assembly-transform-field span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ddcff;
}

.assembly-transform-field input {
  width: 100%;
  height: 38px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #eef8ff;
  outline: none;
}

.assembly-transform-field input:focus {
  border-color: rgba(53, 184, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(53, 184, 255, 0.12);
}

:root {
  --assembly-accent: #FBBF24;
  --assembly-purple: #6D28D9;
  --assembly-teal: #1BA6A6;
  --assembly-text: #EEF8FF;
  --assembly-bg-top: rgba(15, 10, 34, 0.96);
  --assembly-bg-bottom: rgba(8, 12, 24, 0.96);
  --assembly-border: rgba(109, 40, 217, 0.28);
  --assembly-soft: rgba(109, 40, 217, 0.12);
}

.assembly-picker-wrap {
  background: linear-gradient(180deg, var(--assembly-bg-top) 0%, var(--assembly-bg-bottom) 100%);
  border-color: var(--assembly-border);
}

.assembly-builder-top {
  background:
    linear-gradient(90deg, rgba(109, 40, 217, 0.22) 0%, rgba(27, 166, 166, 0.14) 100%),
    rgba(7, 12, 18, 0.94);
  border-bottom-color: var(--assembly-border);
}

.assembly-builder-subtitle,
.assembly-label,
.assembly-inspector-title,
.assembly-transform-field span {
  color: var(--assembly-accent);
}

.assembly-sidebar,
.assembly-inspector {
  background: linear-gradient(180deg, rgba(18, 14, 34, 0.92) 0%, rgba(8, 14, 22, 0.94) 100%);
}

.assembly-action-btn {
  background: linear-gradient(135deg, var(--assembly-accent) 0%, #f59e0b 100%);
  color: #2a1705;
}

.assembly-project-open-btn {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.28) 0%, rgba(27, 166, 166, 0.28) 100%);
  color: var(--assembly-text);
  border: 1px solid rgba(109, 40, 217, 0.18);
}

.assembly-part-btn.active {
  outline: 2px solid rgba(251, 191, 36, 0.85);
  background: rgba(251, 191, 36, 0.1);
}

.assembly-transform-field input:focus,
.assembly-new-project-input:focus {
  border-color: rgba(109, 40, 217, 0.78);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.16);
}

.assembly-diagram-summary {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(27, 166, 166, 0.2);
  background: rgba(27, 166, 166, 0.08);
  color: rgba(238, 248, 255, 0.86);
  font-size: 12px;
  line-height: 1.45;
}

.assembly-diagram-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.52);
  backdrop-filter: blur(6px);
  z-index: 2500;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.assembly-diagram-modal.visible {
  display: flex;
}

.assembly-diagram-modal.is-open {
  opacity: 1;
}

.assembly-diagram-window {
  width: min(1320px, 96vw);
  height: min(860px, 92vh);
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(17, 12, 36, 0.98) 0%, rgba(10, 14, 24, 0.98) 100%);
  border: 1px solid rgba(109, 40, 217, 0.32);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  transform: translateY(18px) scale(0.985);
  transition: transform 0.2s ease;
}

.assembly-diagram-modal.is-open .assembly-diagram-window {
  transform: translateY(0) scale(1);
}

.assembly-diagram-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(109, 40, 217, 0.22);
  background:
    linear-gradient(90deg, rgba(109, 40, 217, 0.2) 0%, rgba(27, 166, 166, 0.12) 100%);
}

.assembly-diagram-title {
  margin: 0;
  font-size: 24px;
  color: var(--assembly-text);
}

.assembly-diagram-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  height: calc(100% - 73px);
}

.assembly-diagram-paper {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgba(109, 40, 217, 0.06) 0%, transparent 36%),
    linear-gradient(180deg, #fbfaf5 0%, #f3efe5 100%);
}

.assembly-diagram-paper::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(109, 40, 217, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 166, 166, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.assembly-diagram-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

.assembly-diagram-wire {
  fill: none;
  stroke: #FBBF24;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.98;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.35));
}

.assembly-diagram-wire--draft {
  stroke-dasharray: 9 7;
  opacity: 0.7;
}

.assembly-diagram-wire--selected {
  stroke: #22d3ee;
  stroke-width: 5;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.62));
}

.assembly-diagram-wire-hit {
  fill: none;
  stroke: rgba(0, 0, 0, 0);
  stroke-width: 18;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: stroke;
  cursor: pointer;
}

.assembly-diagram-nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.assembly-diagram-node {
  position: absolute;
  width: 240px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(20, 16, 34, 0.94);
  border: 1px solid rgba(109, 40, 217, 0.28);
  box-shadow: 0 18px 40px rgba(28, 18, 58, 0.2);
}

.assembly-diagram-node.is-connected {
  border-color: rgba(34, 211, 238, 0.78);
  box-shadow:
    0 18px 40px rgba(28, 18, 58, 0.2),
    0 0 0 2px rgba(34, 211, 238, 0.24);
}

.assembly-diagram-node-head {
  padding: 12px 14px;
  cursor: grab;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.28) 0%, rgba(27, 166, 166, 0.2) 100%);
}

.assembly-diagram-node-head:active {
  cursor: grabbing;
}

.assembly-diagram-node-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff7db;
}

.assembly-diagram-node-sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(238, 248, 255, 0.8);
}

.assembly-diagram-node-body {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  gap: 10px;
  padding: 12px;
}

.assembly-diagram-node-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.assembly-diagram-chip {
  width: 40px;
  height: 96px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1c1338 0%, #0f1020 100%);
  border: 1px solid rgba(251, 191, 36, 0.2);
  box-shadow: inset 0 0 0 1px rgba(27, 166, 166, 0.15);
}

.assembly-diagram-pin-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assembly-diagram-pin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  color: #eef8ff;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.assembly-diagram-pin:hover {
  transform: translateY(-1px);
}

.assembly-diagram-pin.pending {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.95);
}

.assembly-diagram-pin.is-connected {
  background: rgba(34, 211, 238, 0.24);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.9);
}

.assembly-diagram-pin--power {
  background: rgba(251, 191, 36, 0.15);
}

.assembly-diagram-pin--ground {
  background: rgba(109, 40, 217, 0.18);
}

.assembly-diagram-pin--signal {
  background: rgba(27, 166, 166, 0.18);
}

.assembly-diagram-pin--motor {
  background: rgba(255, 255, 255, 0.1);
}

.assembly-pin-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff8da;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
  flex: 0 0 auto;
}

.assembly-diagram-side {
  overflow: auto;
  padding: 18px;
  background: linear-gradient(180deg, rgba(17, 12, 34, 0.98) 0%, rgba(10, 14, 24, 0.98) 100%);
  border-left: 1px solid rgba(109, 40, 217, 0.2);
}

.assembly-diagram-connection-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.assembly-diagram-connection-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  cursor: pointer;
}

.assembly-diagram-connection-row.is-selected {
  background: rgba(34, 211, 238, 0.16);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.42);
}

.assembly-diagram-connection-arrow {
  color: #FBBF24;
  font-weight: 900;
}

.assembly-diagram-remove {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(109, 40, 217, 0.24);
  color: #eef8ff;
  cursor: pointer;
}

.assembly-diagram-delete-selected {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(34, 211, 238, 0.2);
  color: #eef8ff;
  font-weight: 800;
  cursor: pointer;
}

.assembly-diagram-delete-selected:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .assembly-diagram-layout {
    grid-template-columns: 1fr;
  }

  .assembly-diagram-side {
    border-left: 0;
    border-top: 1px solid rgba(109, 40, 217, 0.2);
  }
}

.assembly-diagram-paper {
  position: relative;
  overflow: hidden;
  cursor: grab;
}

.assembly-diagram-paper.is-panning {
  cursor: grabbing;
}

.assembly-diagram-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 4200px;
  height: 2800px;
  transform-origin: 0 0;
  will-change: transform;
}

.assembly-diagram-svg,
.assembly-diagram-nodes {
  position: absolute;
  inset: 0;
}

.assembly-diagram-svg {
  width: 4200px;
  height: 2800px;
  overflow: visible;
}

.assembly-diagram-node {
  touch-action: none;
}

.assembly-diagram-node-head {
  cursor: grab;
}

.assembly-diagram-node-head:active {
  cursor: grabbing;
}


/* ===== Code Editor Modal ===== */

.assembly-code-window {
  width: min(1440px, 96vw);
  height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(24, 14, 58, 0.96) 0%, rgba(3, 10, 24, 0.97) 100%);
  border: 1px solid rgba(88, 116, 255, 0.28);
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.assembly-code-window .assembly-diagram-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(96, 132, 255, 0.18);
  background: linear-gradient(90deg, rgba(54, 26, 120, 0.42), rgba(23, 38, 88, 0.2));
}

.assembly-code-window .assembly-builder-subtitle {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffcb3d;
}

.assembly-code-window .assembly-diagram-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  color: #eef4ff;
}

.assembly-code-window .assembly-builder-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.assembly-code-window .assembly-project-open-btn,
.assembly-code-window .assembly-action-btn,
.assembly-code-window .assembly-close-btn {
  height: 42px;
  border-radius: 14px;
}

.assembly-code-window .assembly-project-open-btn {
  padding: 0 16px;
  border: 1px solid rgba(94, 136, 255, 0.24);
  background: linear-gradient(180deg, rgba(63, 89, 176, 0.85), rgba(29, 88, 108, 0.85));
  color: #eef5ff;
  font-weight: 700;
}

.assembly-code-window .assembly-action-btn {
  padding: 0 18px;
  border: 0;
  background: linear-gradient(180deg, #ffbf1f, #f2a900);
  color: #211300;
  font-weight: 800;
}

.assembly-code-window .assembly-close-btn {
  min-width: 42px;
  padding: 0 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #f3f6ff;
  font-size: 20px;
}

.assembly-code-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  overflow: hidden;
}

.assembly-code-side {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(5, 14, 32, 0.92), rgba(3, 10, 24, 0.92));
  border: 1px solid rgba(86, 145, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.assembly-code-side .assembly-inspector-title {
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffcb3d;
}

.assembly-code-mapping-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assembly-code-mapping-list .assembly-diagram-connection-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.assembly-code-mapping-list .assembly-diagram-connection-row strong {
  display: block;
  margin-bottom: 2px;
  color: #dceaff;
  font-size: 12px;
  line-height: 1.35;
}

.assembly-code-mapping-list .assembly-diagram-connection-row div {
  font-size: 11px;
  line-height: 1.35;
  color: rgba(214, 226, 255, 0.7);
  word-break: break-word;
}

.assembly-code-mapping-list .assembly-diagram-connection-arrow {
  color: #ffbf1f;
  font-size: 16px;
  font-weight: 800;
}

.assembly-code-editor-wrap {
  min-width: 0;
  min-height: 0;
  display: flex;
}

.assembly-code-editor {
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  padding: 18px 18px 22px;
  border-radius: 18px;
  border: 1px solid rgba(86, 145, 255, 0.18);
  background: linear-gradient(180deg, rgba(2, 12, 28, 0.98), rgba(1, 9, 22, 0.98));
  color: #e8f1ff;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    0 0 0 1px rgba(10, 26, 54, 0.35);
  font: 15px/1.65 Consolas, Monaco, "Courier New", monospace;
  tab-size: 2;
  white-space: pre;
}

.assembly-code-editor:focus {
  border-color: rgba(99, 162, 255, 0.45);
  box-shadow:
    0 0 0 3px rgba(68, 126, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.assembly-code-side::-webkit-scrollbar,
.assembly-code-editor::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.assembly-code-side::-webkit-scrollbar-thumb,
.assembly-code-editor::-webkit-scrollbar-thumb {
  background: rgba(122, 154, 255, 0.25);
  border-radius: 999px;
}

.assembly-code-side::-webkit-scrollbar-track,
.assembly-code-editor::-webkit-scrollbar-track {
  background: transparent;
}

.assembly-part-thumb--placeholder {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(86, 110, 180, 0.95), rgba(54, 65, 110, 0.95));
  color: #eef4ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

@media (max-width: 980px) {
  .assembly-code-window {
    width: 98vw;
    height: 92vh;
  }

  .assembly-code-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 220px minmax(0, 1fr);
  }
}

@media (max-width: 1200px) {
  .assembly-builder-main {
    grid-template-columns: 280px 1fr;
  }

  .assembly-inspector {
    display: none;
  }
}

@media (max-width: 860px) {
  .assembly-picker-grid,
  .assembly-builder-main {
    grid-template-columns: 1fr;
  }

  .assembly-sidebar {
    display: none;
  }
}
