.mod-memory .mem-wrap {
  display: flex;
  gap: 8px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 6px;
}

.mod-memory .mem-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.mod-memory .mem-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1a12;
  border: 3px solid var(--panel-dark, #2a2d31);
  border-radius: 3px;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.85);
  font-family: var(--font-display, var(--font-mono, 'Courier New', monospace));
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  color: #c8f7d0;
  text-shadow: 0 0 10px rgba(120, 255, 160, 0.75);
}

.mod-memory .mem-row {
  height: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mod-memory .mem-btn {
  min-width: 0;
  font-family: var(--font-mono, 'Courier New', monospace);
  font-size: 26px;
  font-weight: 700;
  color: var(--c-black, #111);
  background: linear-gradient(#f2efe4, #cfcabb);
  border: 2px solid #6d6a60;
  border-radius: 3px;
  box-shadow: 0 3px 0 #4a473f;
  cursor: pointer;
}

.mod-memory .mem-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.mod-memory .mem-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: none;
}

.mod-memory .mem-btn:disabled {
  cursor: default;
  opacity: 0.75;
}

.mod-memory .mem-stages {
  width: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 4px 3px;
  background: var(--c-black, #111);
  border-radius: 3px;
}

.mod-memory .mem-stage {
  height: 14px;
  background: var(--led-off, #2c3a2e);
  border-radius: 2px;
}

.mod-memory .mem-stage.is-on {
  background: var(--c-green, #3ddc63);
  box-shadow: 0 0 6px var(--c-green, #3ddc63);
}
